#include <vector.h>
matvec::Vector<int> a(5);
Definition at line 47 of file vector.h.
Public Types | |
| typedef int | size_type |
| typedef T | value_type |
| typedef T | element_type |
| typedef T * | pointer |
| typedef T * | iterator |
| typedef T & | reference |
| typedef const T * | const_iterator |
| typedef const T * | const_pointer |
| typedef const T & | const_reference |
| typedef std::reverse_iterator< iterator > | reverse_iterator |
| typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
Public Methods | |
| Vector (void) | |
| Constructs an empty vector of type T. | |
| Vector (const size_type n) | |
| Constructs a vector of size n with each element being T(). | |
| Vector (const size_type n, const T *a) | |
| Constructs a vector of size n initialized by *a. | |
| Vector (const Vector &a) | |
| Copy constructor. | |
| iterator | begin (void) |
| returns a random access iterator for the first element. | |
| iterator | end () |
| returns a random access iterator for the position after the last element. | |
| iterator | begin (void) const |
| iterator | end (void) const |
| reverse_iterator | rbegin (void) |
| returns a reverse iterator for the first element of a reverse iteration. | |
| reverse_iterator | rend (void) |
| returns a reverse iterator for the position after the last element of a reverse iteration. | |
| const reverse_iterator | rbegin (void) const |
| const reverse_iterator | rend (void) const |
| virtual | ~Vector (void) |
| Destructs a vector. | |
| void | copy (const Vector &a) |
| Vector & | assign (const Vector &a) |
| Vector & | assign (const T &x) |
| Vector & | resize (const size_type n, const T &val=T()) |
| Vector & | resize (const size_type n, const T *a) |
| Vector & | resize (const Vector &a) |
| Vector & | reserve (const size_type n) |
| Vector & | operator= (const Vector &a) |
| Vector & | operator= (const T &x) |
| Vector | operator+ (const Vector &a) const |
| Vector | operator- (const Vector &a) const |
| Vector | operator * (const Vector &a) const |
| Vector | operator/ (const Vector &a) const |
| Vector | operator+ (const T &x) const |
| Vector | operator- (const T &x) const |
| Vector | operator * (const T &x) const |
| Vector | operator/ (const T &x) const |
| Vector & | operator+= (const Vector &a) |
| Vector & | operator-= (const Vector &a) |
| Vector & | operator *= (const Vector &a) |
| Vector & | operator/= (const Vector &a) |
| Vector & | operator+= (const T &x) |
| Vector & | operator-= (const T &x) |
| Vector & | operator *= (const T &x) |
| Vector & | operator/= (const T &x) |
| T & | operator[] (const size_type i) |
| const T & | operator[] (const size_type i) const |
| T & | operator() (const size_type i) |
| Vector | operator- (void) const |
| Vector & | operator+ (void) |
| Vector< bool > | operator! (void) const |
| Vector< bool > | operator== (const Vector &a) const |
| Vector< bool > | operator< (const Vector &a) const |
| Vector< bool > | operator> (const Vector &a) const |
| Vector< bool > | operator!= (const Vector &a) const |
| Vector< bool > | operator<= (const Vector &a) const |
| Vector< bool > | operator>= (const Vector &a) const |
| Vector< bool > | operator== (const T &x) const |
| Vector< bool > | operator< (const T &x) const |
| Vector< bool > | operator> (const T &x) const |
| Vector< bool > | operator!= (const T &x) const |
| Vector< bool > | operator<= (const T &x) const |
| Vector< bool > | operator>= (const T &x) const |
| bool | all (void) const |
| bool | any (void) const |
| bool | empty (void) const |
| Vector | apply (T(*f)(const T &)) const |
| Vector | apply (T(*f)(const T &, const T &), const Vector &b) const |
| Vector | apply (T(*f)(const T &, const T &), const T &b) const |
| Vector | apply (T(*f)(T)) const |
| Vector | apply (T(*f)(T, T), const Vector &b) const |
| Vector | apply (T(*f)(T, T), const T &b) const |
| Vector & | append (const T &x) |
| Vector & | append (const Vector &a) |
| Vector & | sort (void) |
| T | sum (T init=T()) const |
| T | inner_product (const T *b, T init=T()) const |
| T | inner_product (const Vector &b, T init=T()) const |
| T | inner_product (T init=T()) const |
| T | sumsq (T init=T()) const |
| T | variance (T init=T()) const |
| Vector | subvec (const size_type idx=0, const unsigned len=0) const |
| Vector | subvec (const Vector< bool > &v) const |
| Vector | find (const Vector< bool > &v) const |
| int | find (const T &x) const |
| T | max (void) const |
| T | min (void) const |
| std::ostream & | print (std::ostream &os=std::cout) const |
| T & | at (const size_type i) |
| T & | front (void) |
| const T & | front (void) const |
| T & | back () |
| const T & | back () const |
| int | size (void) const |
| void | clear (void) |
| void | input (const std::string &fname, const size_type n) |
| bool | save (const std::string &fname, const int io_mode=std::ios::out) const |
| void | initialize (size_type n, const T *a) |
Protected Attributes | |
| T * | ve |
it store the pointer to the memory allocated for ne element. | |
| int | ne |
| it stores the number of elements. | |
Related Functions | |
| (Note that these are not member functions.) | |
| Vector< T > | sin (const Vector< T > &a) |
| Vector< T > | asin (const Vector< T > &a) |
| Vector< T > | cos (const Vector< T > &a) |
| Vector< T > | acos (const Vector< T > &a) |
| Vector< T > | tan (const Vector< T > &a) |
| Vector< T > | atan (const Vector< T > &a) |
| Vector< T > | ceil (const Vector< T > &a) |
| Vector< T > | floor (const Vector< T > &a) |
| Vector< T > | log (const Vector< T > &a) |
| Vector< T > | log10 (const Vector< T > &a) |
| Vector< T > | exp (const Vector< T > &a) |
| Vector< T > | sqrt (const Vector< T > &a) |
| Vector< T > | abs (const Vector< T > &a) |
| Vector< T > | erf (const Vector< T > &a) |
| Vector< T > | erfc (const Vector< T > &a) |
| bool | all (const Vector< T > &a) |
| bool | any (const Vector< T > &a) |
| Vector< T > | operator+ (const T &a, const Vector< T > &b) |
| Vector< T > | operator- (const T &a, const Vector< T > &b) |
| Vector< T > | operator * (const T &a, const Vector< T > &b) |
| Vector< T > | operator/ (const T &a, const Vector< T > &b) |
| std::ostream & | operator<< (std::ostream &os, const Vector< T > &a) |
|
|||||
|
|
|
|||||
|
|
|
|||||
|
|
|
|||||
|
Definition at line 60 of file vector.h. Referenced by matvec::Vector< Vector< Sym2x2 > >::rbegin(), and matvec::Vector< Vector< Sym2x2 > >::rend(). |
|
|||||
|
|
|
|||||
|
|||||
|
|
|
|||||
|
|
|
|||||
|
Definition at line 59 of file vector.h. Referenced by matvec::Vector< Vector< Sym2x2 > >::rbegin(), and matvec::Vector< Vector< Sym2x2 > >::rend(). |
|
|||||
|
Definition at line 50 of file vector.h. Referenced by matvec::Vector< Vector< Sym2x2 > >::operator[](), and matvec::Vector< Vector< Sym2x2 > >::Vector(). |
|
|||||
|
|
|
||||||||||
|
Constructs an empty vector of type T.
|
|
||||||||||
|
Constructs a vector of size n with each element being T().
|
|
||||||||||||||||
|
Constructs a vector of size n initialized by *a.
|
|
||||||||||
|
Copy constructor.
|
|
||||||||||
|
Destructs a vector.
|
|
||||||||||
|
Definition at line 644 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ve. Referenced by matvec::Vector< T >::all().
|
|
||||||||||
|
Definition at line 652 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ve. Referenced by matvec::Vector< T >::any().
|
|
||||||||||
|
Definition at line 634 of file vector.h. References matvec::Vector< T >::ne, matvec::Vector< T >::reserve(), and matvec::Vector< T >::ve.
|
|
||||||||||
|
Definition at line 625 of file vector.h. References matvec::Vector< T >::ne, matvec::Vector< T >::reserve(), and matvec::Vector< T >::ve.
|
|
||||||||||||||||
|
Definition at line 617 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||||||||
|
Definition at line 608 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, matvec::Vector< T >::ne, and matvec::Vector< T >::size().
|
|
||||||||||
|
Definition at line 600 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||||||||
|
Definition at line 592 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||||||||
|
Definition at line 583 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, matvec::Vector< T >::ne, and matvec::Vector< T >::size().
|
|
||||||||||
|
Definition at line 575 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne. Referenced by matvec::Vector< T >::abs(), matvec::Vector< T >::acos(), matvec::Vector< T >::asin(), matvec::Vector< T >::atan(), matvec::Vector< T >::ceil(), matvec::Vector< T >::cos(), matvec::Vector< T >::erf(), matvec::Vector< T >::erfc(), matvec::Vector< T >::exp(), matvec::Vector< T >::floor(), matvec::Vector< T >::log(), matvec::Vector< T >::log10(), matvec::Vector< T >::sin(), matvec::Vector< T >::sqrt(), and matvec::Vector< T >::tan().
|
|
||||||||||
|
Definition at line 284 of file vector.h. References matvec::Vector< T >::ne, and matvec::Vector< T >::resize().
|
|
||||||||||
|
Definition at line 278 of file vector.h. References matvec::Vector< T >::copy(). Referenced by matvec::Model::genotypic_value_gibbs(), matvec::Model::get_lms_kp(), matvec::doubleMatrix::inv(), matvec::BGMatrix::inv(), matvec::Vector< Vector< Sym2x2 > >::operator=(), matvec::Model::sampleW(), matvec::Model::setup_ww_single_trait(), matvec::GLMM::SSQCP(), and matvec::Model::vce_gibbs().
00279 {
00280 copy(a);
00281 return *this;
00282 }
|
|
||||||||||
|
It returns a reference to element i with range-cheching. Note that element index starting from 0. Definition at line 202 of file vector.h. References matvec::Vector< T >::ne, and matvec::Vector< T >::ve.
|
|
|||||||||
|
Definition at line 160 of file vector.h.
00160 { return *(end() - 1); }
|
|
|||||||||
|
Definition at line 159 of file vector.h.
00159 { return *(end() - 1); }
|
|
||||||||||
|
Definition at line 69 of file vector.h.
00069 { return ve; }
|
|
||||||||||
|
||||||||||
|
Definition at line 163 of file vector.h. Referenced by matvec::Model::blup_pccg(), matvec::Model::prepare_data(), matvec::Vector< T >::reserve(), matvec::Vector< T >::resize(), and matvec::Vector< Vector< Sym2x2 > >::~Vector().
|
|
||||||||||
|
Definition at line 266 of file vector.h. References matvec::Vector< T >::ne, matvec::Vector< T >::reserve(), and matvec::Vector< T >::ve. Referenced by matvec::Vector< T >::assign().
|
|
||||||||||
|
Definition at line 133 of file vector.h. Referenced by matvec::Model::vce_emreml_multi_trait().
00133 { return ne == 0;}
|
|
||||||||||
|
Definition at line 70 of file vector.h.
|
|
|||||||||
|
||||||||||
|
Definition at line 701 of file vector.h. References matvec::Vector< T >::ne, and matvec::Vector< T >::ve.
|
|
||||||||||
|
Definition at line 711 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::ne, matvec::Vector< T >::size(), and matvec::Vector< T >::ve. Referenced by matvec::Data::input().
00712 {
00713 assert (ne == a.size() );
00714 int n = 0;
00715 bool *bot = a.begin(), *top = a.end();
00716 while (bot < top) if (*bot++) n++;
00717 Vector<T> temp(n);
00718 n = 0;
00719 bot = a.begin();
00720 T *pt = ve;
00721 while (bot < top) {
00722 if (*bot++) temp[n++] = *pt;
00723 pt++;
00724 }
00725 return temp;
00726 }
|
|
||||||||||
|
Definition at line 158 of file vector.h.
00158 { return *begin(); }
|
|
||||||||||
|
Definition at line 157 of file vector.h.
00157 { return *begin(); }
|
|
||||||||||||||||
|
A private member used by constructors. Definition at line 181 of file vector.h. References matvec::check_ptr(), matvec::Vector< T >::ne, and matvec::Vector< T >::ve. Referenced by matvec::Model::hashxact(), and matvec::Vector< Vector< Sym2x2 > >::Vector().
|
|
||||||||||
|
Definition at line 146 of file vector.h.
00146 { return inner_product(this->begin(),init); }
|
|
||||||||||||||||
|
Definition at line 145 of file vector.h.
00145 {return inner_product(b.begin(),init);}
|
|
||||||||||||||||
|
Definition at line 660 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), and matvec::Vector< T >::iterator. Referenced by matvec::Model::blup_pccg(), matvec::Vector< Vector< Sym2x2 > >::inner_product(), matvec::Vector< Vector< Sym2x2 > >::sumsq(), matvec::Vector< T >::variance(), matvec::Model::vce_emreml_multi_trait(), and matvec::Model::vce_gibbs_sampler().
|
|
||||||||||||||||
|
Input data from an external text file.
Definition at line 224 of file vector.h. References matvec::Vector< T >::reserve(), and matvec::Vector< T >::ve.
00225 {
00226 reserve(n);
00227 std::ifstream infile(fname.c_str(),std::ios::in);//SDK | std::ios::nocreate);
00228 if (!infile) throw exception("Vector<T>::input(): cannot open file");
00229 int i = 0;
00230 while (!infile.eof()) {
00231 if (i >= n) break;
00232 infile >> ve[i++];
00233 }
00234 infile.close();
00235 return;
00236 }
|
|
||||||||||
|
Definition at line 153 of file vector.h. Referenced by matvec::GLMM::AI_REML(), matvec::GLMM::Build_SinMat(), matvec::doubleMatrix::cond(), matvec::doubleMatrix::ginv0(), matvec::doubleMatrix::mat_exp(), matvec::doubleMatrix::mat_exp_der(), matvec::doubleMatrix::mat_log(), matvec::Data::max(), matvec::Population::maxant_maxpost(), matvec::Population::maxant_maxpost_old(), matvec::doubleMatrix::norm(), and matvec::Pedigree::renum().
|
|
||||||||||
|
Definition at line 154 of file vector.h. Referenced by matvec::doubleMatrix::cond(), matvec::doubleMatrix::mat_exp(), matvec::doubleMatrix::mat_exp_der(), matvec::doubleMatrix::mat_log(), and matvec::Data::min().
|
|
||||||||||
|
Definition at line 542 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 508 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 399 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), and matvec::Vector< T >::iterator.
|
|
||||||||||
|
Definition at line 369 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 567 of file vector.h.
|
|
||||||||||
|
Definition at line 473 of file vector.h.
00474 { return !(*this == x); }
|
|
||||||||||
|
Definition at line 470 of file vector.h.
00471 { return !(*this == a); }
|
|
||||||||||
|
It returns a reference to element i with range-cheching. Note that element index starting from 1. Definition at line 212 of file vector.h. References matvec::Vector< T >::ne, and matvec::Vector< T >::ve.
|
|
||||||||||
|
Definition at line 113 of file vector.h.
00113 {return *this;}
|
|
||||||||||
|
Definition at line 526 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 489 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 385 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), and matvec::Vector< T >::iterator.
|
|
||||||||||
|
Definition at line 353 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 558 of file vector.h. References matvec::Vector< T >::begin().
|
|
||||||||||
|
Definition at line 534 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 498 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 392 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), and matvec::Vector< T >::iterator.
|
|
||||||||||
|
Definition at line 361 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 550 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 517 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 406 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), and matvec::Vector< T >::iterator.
|
|
||||||||||
|
Definition at line 377 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 442 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 432 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 479 of file vector.h.
00480 { return !(*this > x); }
|
|
||||||||||
|
Definition at line 476 of file vector.h.
00477 { return !(*this > a); }
|
|
||||||||||
|
Definition at line 88 of file vector.h.
00088 { return assign(x); }
|
|
||||||||||
|
Definition at line 87 of file vector.h.
00087 { return assign(a); }
|
|
||||||||||
|
Definition at line 423 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 413 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, matvec::Vector< T >::ne, and matvec::Vector< T >::size().
|
|
||||||||||
|
Definition at line 461 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 451 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, and matvec::Vector< T >::ne.
|
|
||||||||||
|
Definition at line 486 of file vector.h.
00487 { return !(*this < x); }
|
|
||||||||||
|
Definition at line 483 of file vector.h.
00484 { return !(*this < a); }
|
|
||||||||||
|
Definition at line 110 of file vector.h.
00110 {return ve[i];}
|
|
||||||||||
|
Definition at line 109 of file vector.h.
00109 {return ve[i];}
|
|
||||||||||
|
Definition at line 728 of file vector.h. References matvec::Vector< T >::ne, matvec::Session::output_precision, matvec::SESSION, and matvec::Vector< T >::ve. Referenced by matvec::Vector< T >::operator<<(), matvec::Minimizer::praxis(), matvec::print(), and matvec::Vector< T >::save().
|
|
||||||||||
|
Definition at line 73 of file vector.h.
00073 { return const_reverse_iterator(end()); }
|
|
||||||||||
|
returns a reverse iterator for the first element of a reverse iteration.
|
|
||||||||||
|
Definition at line 74 of file vector.h.
00074 { return const_reverse_iterator(begin());}
|
|
||||||||||
|
returns a reverse iterator for the position after the last element of a reverse iteration.
|
|
||||||||||
|
||||||||||
|
Definition at line 84 of file vector.h.
00084 {resize(a.ne); return *this;}
|
|
||||||||||||||||
|
Definition at line 336 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::clear(), matvec::Vector< T >::end(), matvec::Vector< T >::iterator, matvec::Vector< T >::ne, and matvec::Vector< T >::ve.
|
|
||||||||||||||||
|
||||||||||||||||
|
Save the content into an text file.
Definition at line 256 of file vector.h. References matvec::Vector< T >::print().
00257 {
00258 std::ofstream ofs;
00259 ofs.open(fname.c_str(),(OpenModeType)io_mode);
00260 if (!ofs) throw exception("Vector<T>::save(): cannot open file");
00261 print(ofs);
00262 ofs.close();
00263 return true;
00264 }
|
|
||||||||||
|
||||||||||
|
Definition at line 142 of file vector.h.
|
|
||||||||||
|
Definition at line 686 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::size(), and matvec::Vector< T >::ve.
00687 {
00688 int n = 0;
00689 int m = v.size();
00690 bool *ve_pt = v.ve;
00691 int i;
00692 for (i=0; i<m; i++) if (*ve_pt++) n++;
00693
00694 Vector<T> temp(n);
00695 T *t_pt = temp.begin();
00696 ve_pt = v.ve;
00697 for (i=0; i<m; i++) if (*ve_pt++) *t_pt++ = ve[i];
00698 return temp;
00699 }
|
|
||||||||||||||||
|
Definition at line 675 of file vector.h. References matvec::Vector< T >::begin(), matvec::Vector< T >::ne, and matvec::Vector< T >::ve.
|
|
||||||||||
|
Definition at line 143 of file vector.h. Referenced by matvec::Individual::get_penetrance(), matvec::Population::llhood_phenotype(), matvec::Data::sum(), and matvec::Vector< T >::variance().
|
|
||||||||||
|
Definition at line 147 of file vector.h. Referenced by matvec::Data::sumsq().
00147 { return inner_product(this->begin(),init); }
|
|
||||||||||
|
Definition at line 667 of file vector.h. References matvec::Vector< T >::inner_product(), matvec::Vector< T >::ne, and matvec::Vector< T >::sum(). Referenced by matvec::Field::covariance().
00668 {
00669 assert( ne > 1);
00670 T x(sum(init));
00671 init = (inner_product(init) - x*x/ne)/(ne - 1);
00672 return init;
00673 }
|
|
||||||||||
|
returns a vector of abs(a[i]). Definition at line 817 of file vector.h. References matvec::Vector< T >::apply().
00817 {return a.apply(std::abs);}
|
|
||||||||||
|
returns a vector of acos(a[i]). Definition at line 763 of file vector.h. References matvec::Vector< T >::apply().
00763 {return a.apply(std::acos);}
|
|
||||||||||
|
If each element is true return true, otherwise return false. Definition at line 836 of file vector.h. References matvec::Vector< T >::all().
00836 {return a.all();}
|
|
||||||||||
|
If each element is false return false, otherwise return true. Definition at line 843 of file vector.h. References matvec::Vector< T >::any().
00843 {return a.any();}
|
|
||||||||||
|
returns a vector of asin(a[i]). Definition at line 750 of file vector.h. References matvec::Vector< T >::apply().
00750 {return a.apply(std::asin);}
|
|
||||||||||
|
returns a vector of atan(a[i]). Definition at line 775 of file vector.h. References matvec::Vector< T >::apply().
00775 {return a.apply(std::atan);}
|
|
||||||||||
|
returns a vector of ceil(a[i]). Definition at line 781 of file vector.h. References matvec::Vector< T >::apply().
00781 {return a.apply(std::ceil);}
|
|
||||||||||
|
returns a vector of cos(a[i]). Definition at line 757 of file vector.h. References matvec::Vector< T >::apply().
00757 {return a.apply(std::cos);}
|
|
||||||||||
|
returns a vector of erf(a[i]). Definition at line 823 of file vector.h. References matvec::Vector< T >::apply().
00823 {return a.apply(erf);}
|
|
||||||||||
|
returns a vector of erfc(a[i]). Definition at line 829 of file vector.h. References matvec::Vector< T >::apply().
00829 {return a.apply(erfc);}
|
|
||||||||||
|
returns a vector of exp(a[i]). Definition at line 805 of file vector.h. References matvec::Vector< T >::apply().
00805 {return a.apply(std::exp);}
|
|
||||||||||
|
returns a vector of floor(a[i]). Definition at line 787 of file vector.h. References matvec::Vector< T >::apply().
00787 {return a.apply(std::floor);}
|
|
||||||||||
|
returns a vector of log(a[i]). Definition at line 793 of file vector.h. References matvec::Vector< T >::apply().
00793 {return a.apply(std::log);}
|
|
||||||||||
|
returns a vector of log10(a[i]). Definition at line 799 of file vector.h. References matvec::Vector< T >::apply().
00799 {return a.apply(std::log10);}
|
|
||||||||||||||||
|
returns a * b.. Definition at line 864 of file vector.h.
00864 {return b*a;}
|
|
||||||||||||||||
|
returns a + b. Definition at line 850 of file vector.h.
00850 {return b+a;}
|
|
||||||||||||||||
|
returns a - b. Definition at line 857 of file vector.h.
00857 {return -b+a;}
|
|
||||||||||||||||
|
returns a / b Definition at line 871 of file vector.h. References matvec::Vector< T >::size().
00872 {
00873 Vector<T> temp(b.size());
00874 for (int i=0; i<b.size(); ++i) temp[i] = a / b[i];
00875 return temp;
00876 }
|
|
||||||||||||||||
|
It print Vector a to an output stream. Definition at line 882 of file vector.h. References matvec::Vector< T >::print().
00882 {return a.print(os);}
|
|
||||||||||
|
returns a vector of sin(a[i]). Definition at line 744 of file vector.h. References matvec::Vector< T >::apply().
00744 {return a.apply(std::sin);}
|
|
||||||||||
|
returns a vector of sqrt(a[i]). Definition at line 811 of file vector.h. References matvec::Vector< T >::apply().
00811 {return a.apply(std::sqrt);}
|
|
||||||||||
|
returns a vector of tan(a[i]). Definition at line 769 of file vector.h. References matvec::Vector< T >::apply().
00769 {return a.apply(std::tan);}
|
|
|||||
|
|||||
|
it store the pointer to the memory allocated for
Definition at line 174 of file vector.h. Referenced by matvec::Vector< T >::all(), matvec::Vector< T >::any(), matvec::Vector< T >::append(), matvec::Vector< T >::at(), matvec::Vector< Vector< Sym2x2 > >::begin(), matvec::Vector< Vector< Sym2x2 > >::clear(), matvec::Vector< T >::copy(), matvec::Vector< Vector< Sym2x2 > >::end(), matvec::Vector< T >::find(), matvec::Vector< T >::initialize(), matvec::Vector< T >::input(), matvec::Vector< T >::operator()(), matvec::Vector< Vector< Sym2x2 > >::operator[](), matvec::Vector< T >::print(), matvec::Vector< T >::reserve(), matvec::Vector< T >::resize(), matvec::Vector< T >::subvec(), and matvec::Vector< Vector< Sym2x2 > >::Vector(). |
1.2.16