26 #if defined (HAVE_CONFIG_H)
51 (*current_liboctave_error_handler) (
"hess: requires square matrix");
66 double *pscale =
scale.fortran_vec ();
68 F77_XFCN (dgebal, DGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
69 n, h,
n, ilo, ihi, pscale, info
70 F77_CHAR_ARG_LEN (1)));
73 double *ptau = tau.fortran_vec ();
76 double *pwork = work.fortran_vec ();
78 F77_XFCN (dgehrd, DGEHRD, (
n, ilo, ihi, h,
n, ptau, pwork,
81 m_unitary_hess_mat = m_hess_mat;
82 double *z = m_unitary_hess_mat.fortran_vec ();
84 F77_XFCN (dorghr, DORGHR, (
n, ilo, ihi, z,
n, ptau, pwork,
87 F77_XFCN (dgebak, DGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
88 F77_CONST_CHAR_ARG2 (&side, 1),
89 n, ilo, ihi, pscale,
n, z,
92 F77_CHAR_ARG_LEN (1)));
99 for (
F77_INT j = 0; j < a_nc; j++)
100 for (
F77_INT i = j+2; i < a_nr; i++)
101 m_hess_mat.elem (i, j) = 0;
114 (*current_liboctave_error_handler) (
"hess: requires square matrix");
129 float *pscale =
scale.fortran_vec ();
131 F77_XFCN (sgebal, SGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
132 n, h,
n, ilo, ihi, pscale, info
133 F77_CHAR_ARG_LEN (1)));
136 float *ptau = tau.fortran_vec ();
139 float *pwork = work.fortran_vec ();
141 F77_XFCN (sgehrd, SGEHRD, (
n, ilo, ihi, h,
n, ptau, pwork,
144 m_unitary_hess_mat = m_hess_mat;
145 float *z = m_unitary_hess_mat.fortran_vec ();
147 F77_XFCN (sorghr, SORGHR, (
n, ilo, ihi, z,
n, ptau, pwork,
150 F77_XFCN (sgebak, SGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
151 F77_CONST_CHAR_ARG2 (&side, 1),
152 n, ilo, ihi, pscale,
n, z,
155 F77_CHAR_ARG_LEN (1)));
162 for (
F77_INT j = 0; j < a_nc; j++)
163 for (
F77_INT i = j+2; i < a_nr; i++)
164 m_hess_mat.elem (i, j) = 0;
177 (*current_liboctave_error_handler) (
"hess: requires square matrix");
192 double *pscale =
scale.fortran_vec ();
194 F77_XFCN (zgebal, ZGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
196 F77_CHAR_ARG_LEN (1)));
199 Complex *ptau = tau.fortran_vec ();
202 Complex *pwork = work.fortran_vec ();
207 m_unitary_hess_mat = m_hess_mat;
208 Complex *z = m_unitary_hess_mat.fortran_vec ();
214 F77_XFCN (zgebak, ZGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
215 F77_CONST_CHAR_ARG2 (&side, 1),
218 F77_CHAR_ARG_LEN (1)));
225 for (
F77_INT j = 0; j < a_nc; j++)
226 for (
F77_INT i = j+2; i < a_nr; i++)
227 m_hess_mat.elem (i, j) = 0;
241 (*current_liboctave_error_handler) (
"hess: requires square matrix");
258 float *pscale =
scale.fortran_vec ();
260 F77_XFCN (cgebal, CGEBAL, (F77_CONST_CHAR_ARG2 (&job, 1),
262 F77_CHAR_ARG_LEN (1)));
273 m_unitary_hess_mat = m_hess_mat;
280 F77_XFCN (cgebak, CGEBAK, (F77_CONST_CHAR_ARG2 (&job, 1),
281 F77_CONST_CHAR_ARG2 (&side, 1),
284 F77_CHAR_ARG_LEN (1)));
291 for (
F77_INT j = 0; j < a_nc; j++)
292 for (
F77_INT i = j+2; i < a_nr; i++)
293 m_hess_mat.elem (i, j) = 0;
298 OCTAVE_END_NAMESPACE(math)
299 OCTAVE_END_NAMESPACE(
octave)
T * fortran_vec()
Size of the specified dimension.
octave_idx_type rows() const
octave_idx_type cols() const
Vector representing the dimensions (size) of an Array.
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#define F77_DBLE_CMPLX_ARG(x)
#define F77_XFCN(f, F, args)
octave_f77_int_type F77_INT
void scale(Matrix &m, double x, double y, double z)
std::complex< double > Complex
std::complex< float > FloatComplex