use Math::Complex; # Get the data, put it in hash called: %form if($ENV{'REQUEST_METHOD'} eq 'POST'){ read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); } else{ @pairs = split(/&/, $ENV{'QUERY_STRING'}); } foreach $pair (@pairs){ local($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $form{$name} = $value; } for($i=1;$i<($var_no+1);$i+=1){ for($j=1;$j<=($var_no+1);$j+=1){ $deger = "val-".$i."-".$j; @kompleksler = split(/\+/,$form{$deger}); $imaginary = 0; $real = 0; foreach $complex (@kompleksler){ if($complex =~ m/(i|j)/){ $imaginary += $complex; } else{ $real += $complex; } } $matrix[$i][$j] = cplx($real, $imaginary); } }
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: Obtain matrix info
by davorg (Chancellor) on Jul 12, 2000 at 15:06 UTC | |
by sinan (Sexton) on Jul 29, 2000 at 20:16 UTC | |
by davorg (Chancellor) on Jul 29, 2000 at 20:33 UTC | |
by sinan (Sexton) on Jul 30, 2000 at 15:18 UTC | |
by davorg (Chancellor) on Jul 30, 2000 at 15:31 UTC | |
| |
| |
by merlyn (Sage) on Jul 29, 2000 at 20:23 UTC | |
RE: Obtain matrix info
by merlyn (Sage) on Jul 29, 2000 at 20:33 UTC | |
by sinan (Sexton) on Jul 30, 2000 at 15:07 UTC | |
RE: Obtain matrix info
by turnstep (Parson) on Jul 17, 2000 at 03:54 UTC | |
by davorg (Chancellor) on Jul 29, 2000 at 20:41 UTC |