Mercurial > octave
comparison liboctave/CRowVector.cc @ 1101:38dabbe2feb5
[project @ 1995-02-14 01:56:51 by jwe]
author | jwe |
---|---|
date | Tue, 14 Feb 1995 01:56:51 +0000 |
parents | 18933dbd5e43 |
children | b6360f2d4fa6 |
comparison
equal
deleted
inserted
replaced
1100:3b6f6c5217e7 | 1101:38dabbe2feb5 |
---|---|
600 void | 600 void |
601 ComplexRowVector::map (c_c_Mapper f) | 601 ComplexRowVector::map (c_c_Mapper f) |
602 { | 602 { |
603 for (int i = 0; i < length (); i++) | 603 for (int i = 0; i < length (); i++) |
604 elem (i) = f (elem (i)); | 604 elem (i) = f (elem (i)); |
605 } | |
606 | |
607 ComplexRowVector | |
608 linspace (const Complex& x1, const Complex& x2, int n) | |
609 { | |
610 ComplexRowVector retval; | |
611 | |
612 if (n > 0) | |
613 { | |
614 retval.resize (n); | |
615 Complex delta = (x2 - x1) / (n - 1); | |
616 retval.elem (0) = x1; | |
617 for (int i = 1; i < n-1; i++) | |
618 retval.elem (i) = x1 + i * delta; | |
619 retval.elem (n-1) = x2; | |
620 } | |
621 | |
622 return retval; | |
605 } | 623 } |
606 | 624 |
607 Complex | 625 Complex |
608 ComplexRowVector::min (void) const | 626 ComplexRowVector::min (void) const |
609 { | 627 { |