Xmipp  v3.23.11-Nereus
matrix1d.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Carlos Oscar S. Sorzano (coss@cnb.csic.es)
4  *
5  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA
21  *
22  * All comments concerning this program package may be sent to the
23  * e-mail address 'xmipp@cnb.csic.es'
24  ***************************************************************************/
25 
26 #ifndef CORE_MATRIX1D_H_
27 #define CORE_MATRIX1D_H_
28 
29 #include <iostream>
30 #include <string>
31 #include <vector>
32 #include "xmipp_error.h"
33 #include "xmipp_macros.h"
34 
35 class FileName;
36 template<typename T>
37 class Matrix2D;
38 
58 #define MATRIX1D_ARRAY(v) ((v).vdata)
59 
72 #define FOR_ALL_ELEMENTS_IN_MATRIX1D(v) \
73  for (size_t i=0; i<v.vdim; i++)
74 
77 #define VEC_XSIZE(m) ((m).vdim)
78 
85 #define XX(v) (v).vdata[0]
86 
93 #define YY(v) (v).vdata[1]
94 
101 #define ZZ(v) (v).vdata[2]
102 
112 #define VECTOR_R2(v, x, y) { \
113  XX(v) = x; YY(v) = y; }
114 
124 #define VECTOR_R3(v, x, y, z) { \
125  XX(v) = x; YY(v) = y; ZZ(v) = z;}
126 
134 #define V2_PLUS_V2(a, b, c) { \
135  XX(a) = XX(b) + XX(c); \
136  YY(a) = YY(b) + YY(c); }
137 
145 #define V2_MINUS_V2(a, b, c) { \
146  XX(a) = XX(b) - XX(c); \
147  YY(a) = YY(b) - YY(c); }
148 
162 #define V2_PLUS_CT(a, b, k) { \
163  XX(a) = XX(b) + (k); \
164  YY(a) = YY(b) + (k); }
165 
179 #define V2_BY_CT(a, b, k) { \
180  XX(a) = XX(b) * (k); \
181  YY(a) = YY(b) * (k); }
182 
190 #define V3_PLUS_V3(a, b, c) { \
191  XX(a) = XX(b) + XX(c); \
192  YY(a) = YY(b) + YY(c); \
193  ZZ(a) = ZZ(b) + ZZ(c); }
194 
202 #define V3_MINUS_V3(a, b, c) { \
203  XX(a) = XX(b) - XX(c); \
204  YY(a) = YY(b) - YY(c); \
205  ZZ(a) = ZZ(b) - ZZ(c); }
206 
220 #define V3_PLUS_CT(a, b, c) { \
221  XX(a) = XX(b) + (c); \
222  YY(a) = YY(b) + (c); \
223  ZZ(a) = ZZ(b) + (c); }
224 
238 #define V3_BY_CT(a, b, c) { \
239  XX(a) = XX(b) * (c); \
240  YY(a) = YY(b) * (c); \
241  ZZ(a) = ZZ(b) * (c); }
242 
245 #define VEC_ELEM(v,i) ((v).vdata[(i)])
246 #define dMi(v, i) ((v).vdata[(i)])
247 
248 #define VEC_SWAP(v, i, j, aux) {aux = dMi(v, i); dMi(v, i) = dMi(v, j); dMi(v, j) = aux; }
249 
251 
253 template<typename T>
254 class Matrix1D
255 {
256 public:
258  T* vdata;
259 
262 
264  size_t vdim;
265 
267  bool row;
268 
270 
271 
286  Matrix1D(bool column = true)
287  {
288  coreInit();
289  row = !column;
290  }
291 
308  template<class T1>
309  Matrix1D(T1 dim, bool column = true)
310  {
311  coreInit();
312  row = !column;
313  initZeros(dim);
314  }
315 
326  {
327  coreInit();
328  *this = v;
329  row = v.row;
330  }
331 
335  {
336  coreDeallocate();
337  }
338 
349  Matrix1D<T>& operator=(const Matrix1D<T>& op1);
350 
353  bool operator==(const Matrix1D<T>& op1) const;
354 
357  Matrix1D<T>& operator=(const std::vector<T>& op1);
358 
361  void clear();
362 
366  void coreInit();
367 
370  inline void coreAllocate(int _vdim)
371  {
372  if (_vdim <= 0)
373  {
374  clear();
375  return;
376  }
377 
378  vdim = _vdim;
379  vdata = new T[vdim];
380  memset(vdata, 0, vdim * sizeof(T));
381  if (vdata == NULL
382  )
383  REPORT_ERROR(ERR_MEM_NOTENOUGH, "Allocate: No space left");
384  }
385 
389  inline void coreDeallocate()
390  {
391  if (vdata != NULL && destroyData)
392  delete[] vdata;
393  vdata = NULL;
394  }
396 
398 
399 
410  inline void resize(size_t Xdim, bool copy = true)
411  {
412  if (Xdim == vdim)
413  return;
414 
415  if (Xdim <= 0)
416  {
417  clear();
418  return;
419  }
420 
421  T * new_vdata;
422  try
423  {
424  new_vdata = new T[(size_t) Xdim]; //TODO: Kino: Valgrind points here there is something wrong, but I could'nt resolve
425  memset(new_vdata, 0, Xdim * sizeof(T));
426  }
427  catch (std::bad_alloc &)
428  {
429  REPORT_ERROR(ERR_MEM_NOTENOUGH, "Allocate: No space left");
430  }
431 
432  // Copy needed elements, fill with 0 if necessary
433  if (copy)
434  {
435  T zero=0; // Useful for complexes
436  for (size_t j = 0; j < Xdim; j++)
437  {
438  T *val=NULL;
439  if (j >= vdim)
440  val = &zero;
441  else
442  val = &vdata[j];
443  new_vdata[j] = *val;
444  }
445  }
446 
447  // deallocate old vector
448  coreDeallocate();
449 
450  // assign *this vector to the newly created
451  vdata = new_vdata;
452  vdim = Xdim;
453 
454  }
455 
458  inline void resizeNoCopy(int Xdim)
459  {
460  resize(Xdim, false);
461  }
462 
475  template<typename T1>
476  void resize(const Matrix1D<T1> &v)
477  {
478  if (vdim != v.vdim)
479  resize(v.vdim);
480  }
481 
484  template<typename T1>
485  void resizeNoCopy(const Matrix1D<T1> &v)
486  {
487  if (vdim != v.vdim)
488  resize(v.vdim, false);
489  }
490 
496  template<typename T1>
497  bool sameShape(const Matrix1D<T1>& op) const
498  {
499  return (vdim == op.vdim);
500  }
501 
508  inline size_t size() const
509  {
510  return vdim;
511  }
512 
520  inline int isRow() const
521  {
522  return row;
523  }
524 
532  inline int isCol() const
533  {
534  return !row;
535  }
536 
543  inline void setRow()
544  {
545  row = true;
546  }
547 
554  inline void setCol()
555  {
556  row = false;
557  }
559 
561 
562 
572  void initConstant(T val);
573 
576  void initConstant(size_t Xdim, T val);
577 
578 
581  void enumerate();
582 
592  inline void initZeros()
593  {
594  memset(vdata, 0, vdim * sizeof(T));
595  }
596 
599  inline void initZeros(size_t Xdim)
600  {
601  if (vdim != Xdim)
602  resizeNoCopy(Xdim);
603  memset(vdata, 0, vdim * sizeof(T));
604  }
605 
615  template<typename T1>
616  inline void initZeros(const Matrix1D<T1>& op)
617  {
618  if (vdim != op.vdim)
619  resize(op);
620  memset(vdata, 0, vdim * sizeof(T));
621  }
623 
626  bool isAnyNaN();
627 
629 
630 
632  Matrix1D<T> operator*(T op1) const;
633 
636  Matrix1D<T> operator/(T op1) const;
637 
640  Matrix1D<T> operator+(T op1) const;
641 
644  Matrix1D<T> operator-(T op1) const;
645 
648  friend Matrix1D<T> operator*(T op1, const Matrix1D<T>& op2)
649  {
650  Matrix1D<T> tmp(op2);
651  T *ptr1 = &VEC_ELEM(tmp,0);
652  const T *ptr2 = &VEC_ELEM(op2,0);
653  size_t iBlockMax = op2.vdim / 4;
654  for (size_t i = 0; i < iBlockMax; i++)
655  {
656  (*ptr1++) = (*ptr2++) * op1;
657  (*ptr1++) = (*ptr2++) * op1;
658  (*ptr1++) = (*ptr2++) * op1;
659  (*ptr1++) = (*ptr2++) * op1;
660  }
661  for (size_t i = iBlockMax * 4; i < op2.vdim; ++i)
662  (*ptr1++) = (*ptr2++) * op1;
663  return tmp;
664  }
665 
668  friend Matrix1D<T> operator/(T op1, const Matrix1D<T>& op2)
669  {
670  Matrix1D<T> tmp(op2);
671  T *ptr1 = &VEC_ELEM(tmp,0);
672  const T *ptr2 = &VEC_ELEM(op2,0);
673  size_t iBlockMax = op2.vdim / 4;
674  for (size_t i = 0; i < iBlockMax; i++)
675  {
676  (*ptr1++) = op1 / (*ptr2++);
677  (*ptr1++) = op1 / (*ptr2++);
678  (*ptr1++) = op1 / (*ptr2++);
679  (*ptr1++) = op1 / (*ptr2++);
680  }
681  for (size_t i = iBlockMax * 4; i < op2.vdim; ++i)
682  (*ptr1++) = op1 / (*ptr2++);
683  return tmp;
684  }
685 
688  friend Matrix1D<T> operator+(T op1, const Matrix1D<T>& op2)
689  {
690  Matrix1D<T> tmp(op2);
691  T *ptr1 = &VEC_ELEM(tmp,0);
692  const T *ptr2 = &VEC_ELEM(op2,0);
693  size_t iBlockMax = op2.vdim / 4;
694  for (size_t i = 0; i < iBlockMax; i++)
695  {
696  (*ptr1++) = (*ptr2++) + op1;
697  (*ptr1++) = (*ptr2++) + op1;
698  (*ptr1++) = (*ptr2++) + op1;
699  (*ptr1++) = (*ptr2++) + op1;
700  }
701  for (size_t i = iBlockMax * 4; i < op2.vdim; ++i)
702  (*ptr1++) = (*ptr2++) + op1;
703  return tmp;
704  }
705 
708  friend Matrix1D<T> operator-(T op1, const Matrix1D<T>& op2)
709  {
710  Matrix1D<T> tmp(op2);
711  T *ptr1 = &VEC_ELEM(tmp,0);
712  const T *ptr2 = &VEC_ELEM(op2,0);
713  size_t iBlockMax = op2.vdim / 4;
714  for (size_t i = 0; i < iBlockMax; i++)
715  {
716  (*ptr1++) = op1 - (*ptr2++);
717  (*ptr1++) = op1 - (*ptr2++);
718  (*ptr1++) = op1 - (*ptr2++);
719  (*ptr1++) = op1 - (*ptr2++);
720  }
721  for (size_t i = iBlockMax * 4; i < op2.vdim; ++i)
722  (*ptr1++) = op1 - (*ptr2++);
723  return tmp;
724  }
725 
732  void operator+=(const Matrix1D<T>& op1) const;
733 
740  void operator-=(const Matrix1D<T>& op1) const;
741 
744  void operator*=(T op1);
745 
748  void operator/=(T op1);
749 
752  void operator+=(T op1);
753 
756  void operator-=(T op1);
757 
760  Matrix1D<T> operator*(const Matrix1D<T>& op1) const;
761 
764  Matrix1D<T> operator/(const Matrix1D<T>& op1) const;
767  Matrix1D<T> operator+(const Matrix1D<T>& op1) const;
768 
771  Matrix1D<T> operator-(const Matrix1D<T>& op1) const;
772 
775  void operator*=(const Matrix1D<T>& op1);
776 
779  void operator/=(const Matrix1D<T>& op1);
780 
783  void operator+=(const Matrix1D<T>& op1);
784 
787  void operator-=(const Matrix1D<T>& op1);
788 
799  Matrix1D<T> operator-() const;
800 
807 
819  inline T& operator()(int i) const
820  {
821  return vdata[i];
822  }
823 
824  inline T& operator [](int idx) {
825  return vdata[idx];
826  }
827 
828  inline T operator [](int idx) const {
829  return vdata[idx];
830  }
831 
833 
834 
844  inline T* adaptForNumericalRecipes() const
845  {
846  return MATRIX1D_ARRAY(*this) - 1;
847  }
848 
856  {}
857 
863  void selfCEIL();
864 
870  void selfFLOOR();
871 
877  void selfROUND();
878 
888  Matrix1D<T> sort() const;
889 
898  void indexSort(Matrix1D<int> &indx) const;
899 
901  double computeMean() const;
902 
904  T computeMax() const;
905 
907  void computeMinMax(T &minval, T &maxval) const;
908 
910  void computeMeanAndStddev(double &mean, double &stddev) const;
911 
913  T computeMedian() const;
914 
920  int maxIndex() const;
921 
927  int minIndex() const;
928 
938  Matrix1D<T> transpose() const;
939 
944  inline void selfTranspose()
945  {
946  row = !row;
947  }
948 
957  double sum(bool average = false) const;
958 
968  double sum2() const;
969 
972  double dotProduct(const Matrix1D<T> &op1) const;
973 
983  inline double module() const
984  {
985  return sqrt(sum2());
986  }
987 
993  inline double angle() const
994  {
995  return atan2((double) YY(*this), (double) XX(*this));
996  }
997 
1000  void selfNormalize();
1001 
1004  void selfReverse();
1005 
1011  void showWithGnuPlot(const std::string& xlabel, const std::string& title);
1012 
1020  void numericalDerivative(Matrix1D<double> &result) const;
1021 
1026  void read(const FileName& fn);
1027 
1039  // This function must be explicitly implemented outside
1041  {
1042  for (int i = 0; i < VEC_XSIZE(v); i++)
1043  in >> VEC_ELEM(v,i);
1044  return in;
1045  }
1046 
1048  friend std::ostream& operator<<(std::ostream& ostrm, const Matrix1D<T>& v)
1049  {
1050  if (v.vdim == 0)
1051  ostrm << "NULL Array\n";
1052  else
1053  ostrm << std::endl;
1054 
1055  double max_val = ABS(v.vdata[0]);
1056 
1057  for (size_t j = 0; j < v.vdim; j++)
1058  {
1059  max_val = XMIPP_MAX(max_val, v.vdata[j]);
1060  }
1061 
1062  int prec = bestPrecision(max_val, 10);
1063 
1064  if (v.row)
1065  for (size_t j = 0; j < v.vdim; j++)
1066  {
1067  ostrm << floatToString((double) v.vdata[j], 10, prec)
1068  << std::endl;
1069  }
1070  else
1071  for (size_t j = 0; j < v.vdim; j++)
1072  {
1073  ostrm << floatToString((double) v.vdata[j], 10, prec) << " ";
1074  }
1075 
1076  return ostrm;
1077  }
1078 
1081  void write(const FileName& fn) const;
1082 
1089  void edit();
1091 };
1092 
1093 
1096 
1108 Matrix1D<double> vectorR2(double x, double y);
1109 
1117 Matrix1D<double> vectorR3(double x, double y, double z);
1118 
1121 Matrix1D<int> vectorR3(int x, int y, int z);
1122 
1139 template<typename T>
1140 T dotProduct(const Matrix1D<T>& v1, const Matrix1D<T>& v2)
1141 {
1142  if (!v1.sameShape(v2))
1144  "Dot product: vectors of different size or shape");
1145 
1146  T accumulate = 0;
1147  for (size_t j = 0; j < v1.vdim; j++)
1148  accumulate += v1.vdata[j] * v2.vdata[j];
1149  return accumulate;
1150 }
1151 
1164 template<typename T>
1166 {
1167  if (v1.vdim != 3 || v2.vdim != 3)
1168  REPORT_ERROR(ERR_MATRIX_SIZE, "Vector_product: vectors are not in R3");
1169 
1170  if (v1.isRow() != v2.isRow())
1172  "Vector_product: vectors are of different shape");
1173 
1174  Matrix1D<T> result(3);
1175  vectorProduct(v1, v2, result);
1176  return result;
1177 }
1178 
1185 template<typename T>
1186 void vectorProduct(const Matrix1D<T>& v1, const Matrix1D<T>& v2,
1187  Matrix1D<T> &result)
1188 {
1189  XX(result) = YY(v1) * ZZ(v2) - ZZ(v1) * YY(v2);
1190  YY(result) = ZZ(v1) * XX(v2) - XX(v1) * ZZ(v2);
1191  ZZ(result) = XX(v1) * YY(v2) - YY(v1) * XX(v2);
1192 }
1193 
1205 template<typename T>
1207 {
1208  T temp;
1209  if (!v1.sameShape(v2))
1211  "sortTwoVectors: vectors are not of the same shape");
1212 
1213  for (size_t j = 0; j < v1.vdim; j++)
1214  {
1215  temp = XMIPP_MIN(v1.vdata[j], v2.vdata[j]);
1216  v2.vdata[j] = XMIPP_MAX(v1.vdata[j], v2.vdata[j]);
1217  v1.vdata[j] = temp;
1218  }
1219 }
1220 
1226 template<typename T1, typename T2>
1228 {
1229  if (v1.vdim == 0)
1230  {
1231  v2.clear();
1232  return;
1233  }
1234 
1235  v2.resizeNoCopy(v1.vdim);
1236  for (size_t j = 0; j < v1.vdim; j++)
1237  v2.vdata[j] = static_cast<T2>(v1.vdata[j]);
1238 }
1239 
1243 template<typename T1>
1245 {
1246  v2 = v1;
1247 }
1248 
1250 
1251 #endif /* MATRIX1D_H_ */
void selfROUND()
Definition: matrix1d.cpp:522
friend std::istream & operator>>(std::istream &in, Matrix1D< T > &v)
Definition: matrix1d.h:1040
#define VEC_ELEM(v, i)
Definition: matrix1d.h:245
#define XMIPP_MAX(x, y)
Definition: xmipp_macros.h:193
double module() const
Definition: matrix1d.h:983
void coreInit()
Definition: matrix1d.cpp:74
Matrix1D< double > DVector
Definition: matrix1d.h:1094
void sortTwoVectors(Matrix1D< T > &v1, Matrix1D< T > &v2)
Definition: matrix1d.h:1206
T computeMedian() const
Definition: matrix1d.cpp:842
void clear()
Definition: matrix1d.cpp:67
friend Matrix1D< T > operator+(T op1, const Matrix1D< T > &op2)
Definition: matrix1d.h:688
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
void initZeros(size_t Xdim)
Definition: matrix1d.h:599
void computeMinMax(T &minval, T &maxval) const
Definition: matrix1d.cpp:571
size_t size() const
Definition: matrix1d.h:508
Problem with matrix size.
Definition: xmipp_error.h:152
#define VEC_XSIZE(m)
Definition: matrix1d.h:77
Matrix1D< T > operator-() const
Definition: matrix1d.cpp:444
void indexSort(Matrix1D< int > &indx) const
Definition: matrix1d.cpp:861
void coreDeallocate()
Definition: matrix1d.h:389
void coreAllocate(int _vdim)
Definition: matrix1d.h:370
void sqrt(Image< double > &op)
T & operator[](int idx)
Definition: matrix1d.h:824
Matrix1D< T > operator*(T op1) const
Definition: matrix1d.cpp:114
static double * y
Matrix1D< double > vectorR3(double x, double y, double z)
Definition: matrix1d.cpp:892
There is not enough memory for allocation.
Definition: xmipp_error.h:166
void showWithGnuPlot(const std::string &xlabel, const std::string &title)
Definition: matrix1d.cpp:763
void resizeNoCopy(const Matrix1D< T1 > &v)
Definition: matrix1d.h:485
int bestPrecision(float F, int _width)
double angle() const
Definition: matrix1d.h:993
void enumerate()
Definition: matrix1d.cpp:98
void selfNormalize()
Definition: matrix1d.cpp:723
Matrix1D< T > vectorProduct(const Matrix1D< T > &v1, const Matrix1D< T > &v2)
Definition: matrix1d.h:1165
Matrix1D(const Matrix1D< T > &v)
Definition: matrix1d.h:325
void operator+=(const Matrix1D< T > &op1) const
Definition: matrix1d.cpp:191
bool sameShape(const Matrix1D< T1 > &op) const
Definition: matrix1d.h:497
String floatToString(float F, int _width, int _prec)
void selfTranspose()
Definition: matrix1d.h:944
void write(const FileName &fn) const
Definition: matrix1d.cpp:794
doublereal * x
#define i
void setCol()
Definition: matrix1d.h:554
Matrix1D< T > transpose() const
Definition: matrix1d.cpp:644
int maxIndex() const
Definition: matrix1d.cpp:610
Matrix1D< int > IVector
Definition: matrix1d.h:1095
void read(const FileName &fn)
Definition: matrix1d.cpp:808
void operator-=(const Matrix1D< T > &op1) const
Definition: matrix1d.cpp:211
Definition: mask.h:36
double sum2() const
Definition: matrix1d.cpp:673
~Matrix1D()
Definition: matrix1d.h:334
double v1
double computeMean() const
Definition: matrix1d.cpp:546
#define XX(v)
Definition: matrix1d.h:85
bool isAnyNaN()
Definition: matrix1d.cpp:105
T computeMax() const
Definition: matrix1d.cpp:558
int isRow() const
Definition: matrix1d.h:520
friend Matrix1D< T > operator-(T op1, const Matrix1D< T > &op2)
Definition: matrix1d.h:708
double dotProduct(const Matrix1D< T > &op1) const
Definition: matrix1d.cpp:704
int in
void resize(const Matrix1D< T1 > &v)
Definition: matrix1d.h:476
void initZeros(const Matrix1D< T1 > &op)
Definition: matrix1d.h:616
void resize(size_t Xdim, bool copy=true)
Definition: matrix1d.h:410
#define ABS(x)
Definition: xmipp_macros.h:142
friend Matrix1D< T > operator/(T op1, const Matrix1D< T > &op2)
Definition: matrix1d.h:668
bool row
<0=column vector (default), 1=row vector
Definition: matrix1d.h:267
double z
double sum(bool average=false) const
Definition: matrix1d.cpp:652
Matrix1D< double > vectorR2(double x, double y)
Definition: matrix1d.cpp:884
int isCol() const
Definition: matrix1d.h:532
basic_istream< char, std::char_traits< char > > istream
Definition: utilities.cpp:815
void initZeros()
Definition: matrix1d.h:592
Matrix1D< T > operator/(T op1) const
Definition: matrix1d.cpp:133
#define XMIPP_MIN(x, y)
Definition: xmipp_macros.h:181
#define j
#define YY(v)
Definition: matrix1d.h:93
int m
Matrix1D< T > operator+(T op1) const
Definition: matrix1d.cpp:153
void selfFLOOR()
Definition: matrix1d.cpp:499
void selfReverse()
Definition: matrix1d.cpp:736
#define MATRIX1D_ARRAY(v)
Definition: matrix1d.h:58
Matrix1D(T1 dim, bool column=true)
Definition: matrix1d.h:309
Definition: ctf.h:38
void typeCast(const Matrix1D< T1 > &v1, Matrix1D< T2 > &v2)
Definition: matrix1d.h:1227
T & operator()(int i) const
Definition: matrix1d.h:819
void edit()
Definition: matrix1d.cpp:823
Matrix1D(bool column=true)
Definition: matrix1d.h:286
void numericalDerivative(Matrix1D< double > &result) const
Definition: matrix1d.cpp:746
void resizeNoCopy(int Xdim)
Definition: matrix1d.h:458
void computeMeanAndStddev(double &mean, double &stddev) const
Definition: matrix1d.cpp:588
Matrix1D< T > sort() const
Definition: matrix1d.cpp:850
T * vdata
The array itself.
Definition: matrix1d.h:258
T * adaptForNumericalRecipes() const
Definition: matrix1d.h:844
friend Matrix1D< T > operator*(T op1, const Matrix1D< T > &op2)
Definition: matrix1d.h:648
void operator/=(T op1)
Definition: matrix1d.cpp:247
bool operator==(const Matrix1D< T > &op1) const
Definition: matrix1d.cpp:46
void initConstant(T val)
Definition: matrix1d.cpp:83
bool destroyData
Destroy data.
Definition: matrix1d.h:261
Matrix1D< T > & operator=(const Matrix1D< T > &op1)
Definition: matrix1d.cpp:33
void operator*=(T op1)
Definition: matrix1d.cpp:231
#define ZZ(v)
Definition: matrix1d.h:101
void killAdaptationForNumericalRecipes(T *m) const
Definition: matrix1d.h:855
ql0001_ & zero(ctemp+1),(cvec+1),(a+1),(b+1),(bl+1),(bu+1),(x+1),(w+1), &iout, ifail, &zero,(w+3), &lwar2,(iw+1), &leniw, &glob_grd.epsmac
void selfCEIL()
Definition: matrix1d.cpp:476
void setRow()
Definition: matrix1d.h:543
size_t vdim
Number of elements.
Definition: matrix1d.h:264
int minIndex() const
Definition: matrix1d.cpp:627