21 cerr <<
"Error -- non square matrix passed to "
22 "dvector eigen(const dvar_matrix& m)\n";
27 assert(m1.
rowsize() <= INT_MAX);
29 int n =
static_cast<int>(m1.
rowsize());
61 cerr <<
"Error -- non square matrix passed to "
62 "void tridag(const dmatrix& m)\n";
66 || d.indexmin() != 1 || e.indexmin() !=1 )
68 cerr <<
"Error -- incorrect vector size passed to "
69 "void tridag(const dmatrix& m)\n";
75 int n =
static_cast<int>(m.
rowsize());
86 scale +=
fabs(m[i][k]);
110 g += m[j][k]*m[i][k];
112 g += m[k][j]*m[i][k];
122 m[j][k] -= (f*e[k]+g*m[i][k]);
147 g += m[i][k]*m[k][j];
149 m[k][j] -= g*m[k][i];
154 for (j=1;j<=l;j++) m[j][i]=m[i][j]=0.0;
193 assert(d.size() <= INT_MAX);
195 int n =
static_cast<int>(d.size());
199 for (i=2;i<=n;i++) e[i-1]=e[i];
204 for (m=l;m<=n-1;m++) {
206 if (
fabs(e[m])+dd == dd)
break;
212 cerr <<
"Maximum number of iterations exceeded in"
213 " dvector eigen(const dmatrix& m)\n";
216 g=(d[l+1]-d[l])/(2.0*e[l]);
218 g=d[m]-d[l]+e[l]/(g+
SIGN(r,g));
221 for (i=m-1;i>=l;i--) {
236 r=(d[i]-g)*s+2.0*c*b;
242 for (
int k=1;k<=n;k++)
245 z[k][i+1]=s*z[k][i]+c*f;
246 z[k][i]=c*z[k][i]-s*f;
281 assert(d.size() <= INT_MAX);
283 int n =
static_cast<int>(d.size());
287 for (i=2;i<=n;i++) e[i-1]=e[i];
292 for (m=l;m<=n-1;m++) {
294 if (
fabs(e[m])+dd == dd)
break;
300 cerr <<
"Maximum number of iterations exceeded in"
301 " dvector eigen(const dmatrix& m)\n";
304 g=(d[l+1]-d[l])/(2.0*e[l]);
306 g=d[m]-d[l]+e[l]/(g+
SIGN(r,g));
309 for (i=m-1;i>=l;i--) {
324 r=(d[i]-g)*s+2.0*c*b;
Base class for dvariable.
dvar_vector get_eigen_values(const dvar_vector &_ddd, const dvar_vector &_eee)
Eigenvalues and eigenvectors.
dvector eigenvalues(const banded_symmetric_dmatrix &_SS)
Description not yet available.
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
df1_two_variable fabs(const df1_two_variable &x)
void get_eigen(const dvar_vector &d, const dvar_vector &e, const dvar_matrix &z)
Eigenvalues.
dmatrix symmetrize(const dmatrix &matrix)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void rowshift(int min)
Description not yet available.
unsigned int rowsize() const
void tri_dag(const dvar_matrix &, const dvar_vector &, const dvar_vector &)
Householder transformation for eigenvalue computation.
Class definition of matrix with derivitive information .
dvector value(const df1_one_vector &v)
void colshift(int min)
Description not yet available.
Fundamental data type for reverse mode automatic differentiation.
unsigned int colsize() const