[system] / trunk / pg / macros / PGmorematrixmacros.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/PGmorematrixmacros.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1265 Revision 1274
641 } 641 }
642 if( abs(sqrt($sum) - 1) > $main::functZeroLevelTolDefault ) 642 if( abs(sqrt($sum) - 1) > $main::functZeroLevelTolDefault )
643 { 643 {
644 if( ref( $vec_ref ) eq 'AnswerHash' ){ 644 if( ref( $vec_ref ) eq 'AnswerHash' ){
645 $vec_ref->{score} = 0; 645 $vec_ref->{score} = 0;
646 if( $opts{help} =~ /unit|orthonormal|verbose/ ) 646 if( $opts{mode} =~ /unit|orthonormal|verbose/ )
647 { 647 {
648 $vec_ref->throw_error('EVAL','You have entered vector(s) which are not of unit length.'); 648 $vec_ref->throw_error('EVAL','You have entered vector(s) which are not of unit length.');
649 }else{ 649 }else{
650 $vec_ref->throw_error('EVAL'); 650 $vec_ref->throw_error('EVAL');
651 } 651 }
663 }else{ 663 }else{
664 1; 664 1;
665 } 665 }
666} 666}
667 667
668sub display_correct_vecs{
669 my ( $vec_ref,%opts ) = @_;
670 my $corr_matrix;
671 my @vecs = ();
672
673 if( ref($vec_ref) eq 'AnswerHash' )
674 {
675 $corr_matrix = Matrix->new_from_col_vecs($vec_ref->{correct_ans});
676 }else{
677 $corr_matrix = Matrix->new_from_col_vecs($vec_ref);
678 }
679
680 my @temp = ();
681
682 for( my $i = 0 ; $i < $corr_matrix->[2] ; $i++ ){
683 push @temp, display_matrix($corr_matrix->column($i));
684 push @temp, ",";
685 }
686
687 if( def(@temp) )
688 {
689 pop @temp;
690 }else{
691 @temp = [[" "]];
692 }
693
694
695
696 mbox(\@temp);
697
698}
699
6681; 7001;

Legend:
Removed from v.1265  
changed lines
  Added in v.1274

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9