Psi4
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
psi Namespace Reference

This is all defined in python.cc initialize. More...

Namespaces

 adc
 
 ccdensity
 
 ccenergy
 
 cceom
 
 cchbar
 
 cclambda
 
 ccresponse
 
 cctransort
 
 cctriples
 
 dcft
 
 detcas
 
 detci
 
 df_helper
 
 dfep2
 
 dfmp2
 
 dfoccwave
 
 efp
 
 filesystem
 
 findif
 
 fisapt
 
 fnocc
 
 libfock
 
 mcscf
 
 mrcc
 
 occwave
 
 pk
 
 PointGroups
 
 psimrcc
 
 sapt
 
 scf
 
 scfgrad
 
 SpaceBuilder
 
 SymmOps
 
 thermo
 

Classes

class  PluginFileManager
 
class  Cholesky
 
class  CholeskyMatrix
 
class  CholeskyERI
 
class  CholeskyMP2
 
class  CholeskyDelta
 
class  CholeskyLocal
 
class  Denominator
 
class  LaplaceDenominator
 
class  CholeskyDenominator
 
class  SAPTDenominator
 
class  SAPTLaplaceDenominator
 
class  SAPTCholeskyDenominator
 
class  TLaplaceDenominator
 
class  FittingMetric
 
class  DFTensor
 
class  CubicScalarGrid
 
class  CubeProperties
 
class  DIISEntry
 The DIISManager class is used to manage DIIS quantities and their corresponding error vectors. More...
 
class  DIISManager
 The DIISManager class handles DIIS extrapolations. More...
 
class  Dispersion
 
struct  dpdparams4
 
struct  dpdfile4
 
struct  dpdshift4
 
struct  dpdbuf4
 
struct  dpdtrans4
 
struct  dpdparams2
 
struct  dpdfile2
 
struct  dpd_file4_cache_entry
 
struct  dpd_file2_cache_entry
 
struct  dpd_data
 
struct  thread_data
 
struct  dpd_gbl
 
class  DPD
 
class  DPDMOSpace
 
struct  dpdpair
 
class  RBase
 
class  RCIS
 
class  RTDHF
 
class  RCPHF
 
class  RCPKS
 
class  RTDA
 
class  RTDDFT
 
class  RadialPruneMgr
 
struct  MassPoint
 
class  MolecularGrid
 
class  PseudospectralGrid
 
class  DFTGrid
 
class  RadialGrid
 
class  SphericalGrid
 
class  BlockOPoints
 
class  BasisExtents
 
class  GridBlocker
 
class  NaiveGridBlocker
 
class  OctreeGridBlocker
 
struct  MinimalInterface
 
class  Hamiltonian
 
class  RHamiltonian
 
class  UHamiltonian
 
class  MatrixRHamiltonian
 
class  MatrixUHamiltonian
 
class  CISRHamiltonian
 
class  TDHFRHamiltonian
 
class  CPHFRHamiltonian
 
class  TDARHamiltonian
 
class  TDDFTRHamiltonian
 
class  CPKSRHamiltonian
 
class  USTABHamiltonian
 
class  JK
 
class  DiskJK
 
class  PKJK
 
class  DirectJK
 
class  GTFockJK
 Derived class extending the JK object to GTFock. More...
 
class  DFJK
 
class  CDJK
 
class  BasisFunctions
 
class  PointFunctions
 
class  RKSFunctions
 
class  UKSFunctions
 
class  Solver
 
class  RSolver
 
class  USolver
 
class  CGRSolver
 
class  DLRSolver
 
class  RayleighRSolver
 
class  DLRXSolver
 
class  DLUSolver
 
class  SOMCSCF
 
class  DFSOMCSCF
 
class  DiskSOMCSCF
 
class  IncoreSOMCSCF
 
class  VBase
 
class  RV
 
class  UV
 
class  Functional
 
class  LibXCFunctional
 
class  SuperFunctional
 
struct  iwlbuf
 
class  IWL
 
class  ThreeCenterOverlapInt
 Three center overlap integral. More...
 
class  AngularMomentumInt
 
class  BasisSet
 Basis set container class. More...
 
class  BesselFunction
 Computes a modified spherical Bessel function of the first kind. More...
 
class  CartesianIter
 
class  RedundantCartesianIter
 
class  RedundantCartesianSubIter
 
class  CdSalc
 
class  CdSalcWRTAtom
 
class  CdSalcList
 
class  CoordValue
 
class  NumberValue
 
class  VariableValue
 
class  CoordEntry
 
class  CartesianEntry
 
class  ZMatrixEntry
 
class  CorrelationTable
 
class  CorrelatedFunctor
 
class  ScfRestrictedFunctor
 
class  ScfAndDfCorrelationRestrictedFunctor
 
class  ScfUnrestrictedFunctor
 
class  Deriv
 
class  Dimension
 
class  Slice
 Slicing for Matrices and Vectors objects. More...
 
class  DipoleInt
 Computes dipole integrals. More...
 
class  ShellPairData
 Stores the (shifted) angular momenta, number of cartesians in a shell pair, and shifted centers. More...
 
class  AngularIntegral
 Calculates and stores the angular integrals needed for ECP integration. More...
 
class  RadialIntegral
 Abstracts the calculation of radial integrals for ECP integration. More...
 
class  ECPInt
 
class  ECPSOInt
 
class  EFPMultipolePotentialInt
 
class  ElectricFieldInt
 Computes electric field integrals. More...
 
class  ElectrostaticInt
 
class  Element_to_Z
 
struct  ShellPair_typ
 
class  TwoElectronInt
 
class  ERI
 Capable of computing two-electron repulsion integrals. More...
 
class  F12
 
class  F12Scaled
 
class  F12Squared
 
class  F12G12
 
class  F12DoubleCommutator
 
class  ErfERI
 
class  ErfComplementERI
 
class  ExternalPotential
 
class  MatrixFactory
 A class for creating Matrix, SimpleMatrix, Vector, and SimpleVector objects. More...
 
class  Fjt
 Evaluates the Boys function F_j(T) More...
 
class  Taylor_Fjt
 Uses Taylor interpolation of up to 8-th order to compute the Boys function. More...
 
class  FJT
 
class  GaussianFundamental
 
class  F12Fundamental
 
class  F12ScaledFundamental
 
class  F12SquaredFundamental
 
class  F12G12Fundamental
 
class  F12DoubleCommutatorFundamental
 
class  ErfFundamental
 
class  ErfComplementFundamental
 
class  GCQuadrature
 Performs adaptive Gauss-Chebyshev quadrature for any given function. More...
 
class  GridBlock
 Integration Point/Weight container class (blocks, not individual) More...
 
class  ShellInfo
 This class has the same behavior as GaussianShell, but implements everything using slower data structures, which are easier to construct. These are used to build the basis set, which builds more efficient pointer-based GaussianShell objects. More...
 
class  GaussianShell
 Gaussian orbital shell. More...
 
class  SphericalTransformComponent
 
class  SphericalTransform
 
class  ISphericalTransform
 This describes a solid harmonic to Cartesian transformation. More...
 
class  SphericalTransformIter
 
class  AOIntegralsIterator
 
class  AOShellCombinationsIterator
 
class  SOShellCombinationsIterator
 
class  SO_PQ_Iterator
 
class  SO_RS_Iterator
 
class  IntegralFactory
 
class  IntegralParameters
 
class  CorrelationFactor
 
class  FittedSlaterCorrelationFactor
 
class  KineticInt
 Computes kinetic integrals. More...
 
class  Localizer
 
class  BoysLocalizer
 
class  PMLocalizer
 
class  Matrix
 Makes using matrices just a little easier. More...
 
class  IWLWriter
 
class  MintsHelper
 
class  Molecule
 Molecule information class. More...
 
struct  TwoIndex
 Templated skeleton two index array for convenience. More...
 
struct  ThreeIndex
 Templated skeleton three index array for convenience. More...
 
struct  FiveIndex
 Templated skeleton five index array for convenience. More...
 
struct  SevenIndex
 Templated skeleton seven index array for convenience. More...
 
class  MultipoleInt
 Computes arbitrary-order multipole integrals. More...
 
class  OperatorSymmetry
 
class  MultipoleSymmetry
 
class  NablaInt
 
class  GridIterator
 The GridIterator class: A class to iterate over a user-provided grid for computing electrostatic properties. More...
 
class  Prop
 
class  OEProp
 
class  OneBodyAOInt
 
class  OrbitalSpace
 The OrbitalSpace class. More...
 
class  OverlapOrthog
 
class  ObaraSaikaTwoCenterRecursion
 Generic Obara and Saika recursion object. More...
 
class  ObaraSaikaTwoCenterMIRecursion
 Obara and Saika recursion object for moment integrals. Currently not used by DipoleInt, hopefully soon. THIS CLASS HAS NOT BEEN TESTED!!! More...
 
class  ObaraSaikaTwoCenterVIRecursion
 Obara and Saika recursion object for potential integrals. More...
 
class  ObaraSaikaTwoCenterVIDerivRecursion
 Obara and Saika recursion object for computing potential derivatives. More...
 
class  ObaraSaikaTwoCenterVIDeriv2Recursion
 
class  ObaraSaikaTwoCenterElectricField
 Obara and Saika recursion object for computing electric field integrals. More...
 
class  ObaraSaikaTwoCenterElectricFieldGradient
 Obara and Saika recursion object for computing electric field gradient integrals. More...
 
class  ObaraSaikaTwoCenterEFPRecursion
 Obara and Saika recursion object for potential integrals, and electric derivatives thereof, required in EFP. More...
 
class  ObaraSaikaThreeCenterRecursion
 
class  OverlapInt
 This class computes overlap integrals and soon overlap integral derivatives. Use an IntegralFactory to create this object. More...
 
struct  lin_comb
 
struct  contribution
 
struct  SO
 
struct  SO_block
 
struct  SOCoefficients
 
class  PetiteList
 
class  SymmetryOperation
 
class  SymRep
 
class  IrreducibleRepresentation
 
class  CharacterTable
 
class  PointGroup
 
class  PotentialInt
 Computes potential integrals. Use an IntegralFactory to create this object. More...
 
class  PotentialSOInt
 
class  PCMPotentialInt
 
class  PrintIntegralsFunctor
 
class  ContractOverDensityFunctor
 
class  ContractOverChargesFunctor
 
class  PseudospectralInt
 
class  QuadrupoleInt
 Computes quadrupole integrals. At last check this may not be working. Use an IntegralFactory to create this object. More...
 
class  RelPotentialInt
 Computes relativistic potential integrals. Use an IntegralFactory to create this object. More...
 
class  RelPotentialSOInt
 
class  ShellRotation
 
class  ERISieve
 
class  SimintTwoElectronInt
 
class  SimintERI
 
class  SOTransformFunction
 
class  AOTransformFunction
 
class  SOTransformShell
 
class  SOTransform
 
class  AOTransform
 
class  SOBasisSet
 
class  OneBodySOInt
 
class  TwoBodySOInt
 
class  TracelessQuadrupoleInt
 Computes quadrupole integrals. At last check this may not be working. Use an IntegralFactory to create this object. More...
 
class  TwoBodyAOInt
 
class  Vector
 
class  IntVector
 
class  Vector3
 
class  Wavefunction
 Simple wavefunction base class. More...
 
class  GradientWriter
 
class  FCHKWriter
 
class  MoldenWriter
 
class  MOWriter
 
class  NBOWriter
 
class  X2CInt
 Computes the 1e-X2C kinetic and potential integrals. More...
 
class  ModelSpace
 
class  MOInfo
 
class  MOInfoBase
 
class  MOInfoSCF
 
class  SlaterDeterminant
 
class  DataTypeException
 
class  IndexException
 
class  DuplicateKeyException
 
class  OptionsException
 
class  DataType
 
class  BooleanDataType
 
class  IntDataType
 
class  DoubleDataType
 
class  StringDataType
 
class  IStringDataType
 
class  Data
 
class  ArrayType
 
class  MapType
 
class  Options
 
class  PythonDataType
 
struct  plugin_info_struct
 
class  PsiException
 
class  NotImplementedException_
 
class  SanityCheckError
 
class  SystemError
 
class  FeatureNotImplemented
 
class  LimitExceeded
 
class  StepSizeError
 
class  MaxIterationsExceeded
 
class  ConvergenceError
 
class  ResourceAllocationError
 
class  InputException
 
class  Timer
 
struct  AllocationEntry
 
class  MemoryManager
 
class  Process
 
class  PsiOutStream
 
class  AIOHandler
 
struct  psio_address
 
struct  psio_vol
 
struct  psio_entry
 
struct  psio_ud
 
class  PSIOManager
 
class  PSIO
 
struct  String
 
struct  StringSet
 
struct  SlaterDet
 
struct  _SlaterDetSet
 
struct  SlaterDetVector
 
class  Timer_thread
 
class  Timer_Structure
 
class  LRERI
 
class  DFERI
 
class  LSTHCERI
 
class  THCE
 
class  Tensor
 
class  CoreTensor
 
class  DiskTensor
 
class  IntegralTransform
 
class  FrozenCoreAndFockRestrictedFunctor
 
class  FrozenCoreAndFockUnrestrictedFunctor
 
class  DPDFillerFunctor
 
class  NullFunctor
 
class  MOSpace
 

Typedefs

using SharedMatrix = std::shared_ptr< Matrix >
 
using SharedVector = std::shared_ptr< Vector >
 
typedef _SlaterDetSet SlaterDetSet
 
typedef short int Label
 
typedef double Value
 
typedef struct psi::ShellPair_typ ShellPair
 
typedef std::shared_ptr
< GridBlock
SharedGridBlock
 
typedef std::shared_ptr
< OneBodyAOInt
SharedOneBodyAOInt
 
typedef std::shared_ptr
< OneBodySOInt
SharedOneBodySOInt
 
typedef std::shared_ptr
< TwoBodySOInt
SharedTwoBodySOInt
 
typedef std::vector< std::pair
< int, int > > 
ShellPairBlock
 
typedef std::shared_ptr
< TwoBodyAOInt
SharedTwoBodyAOInt
 
using SharedIntVector = std::shared_ptr< IntVector >
 
using SharedWavefunction = std::shared_ptr< Wavefunction >
 
using SharedMolecule = std::shared_ptr< Molecule >
 
typedef SharedWavefunction(* plugin_t )(SharedWavefunction, Options &)
 
typedef int(* read_options_t )(std::string, Options &)
 
typedef struct
psi::plugin_info_struct 
plugin_info
 
typedef std::vector< std::string > strvec
 
typedef struct psi::psio_entry psio_tocentry
 
using clock = std::chrono::high_resolution_clock
 
typedef std::vector
< std::shared_ptr< MOSpace > > 
SpaceVec
 

Enumerations

enum  indices {
  pqrs, pqsr, prqs, prsq,
  psqr, psrq, qprs, qpsr,
  qrps, qrsp, qspr, qsrp,
  rqps, rqsp, rpqs, rpsq,
  rsqp, rspq, sqrp, sqpr,
  srqp, srpq, spqr, sprq
}
 
enum  pattern {
  abc, acb, cab, cba,
  bca, bac
}
 
enum  GCTYPE { ONEPOINT, TWOPOINT }
 
enum  PrimitiveType { Normalized, Unnormalized }
 
enum  GaussianType { Cartesian = 0, Pure = 1 }
 
enum  ShellType { Gaussian = 0, ECPType1 = 1, ECPType2 = 2 }
 
enum  diagonalize_order { evals_only_ascending = 0, ascending = 1, evals_only_descending = 2, descending = 3 }
 
enum  AxisName { XAxis, YAxis, ZAxis }
 
enum  RotorType {
  RT_ASYMMETRIC_TOP, RT_SYMMETRIC_TOP, RT_SPHERICAL_TOP, RT_LINEAR,
  RT_ATOM
}
 
enum  FullPointGroup {
  PG_ATOM, PG_Cinfv, PG_Dinfh, PG_C1,
  PG_Cs, PG_Ci, PG_Cn, PG_Cnv,
  PG_Cnh, PG_Sn, PG_Dn, PG_Dnd,
  PG_Dnh, PG_Td, PG_Oh, PG_Ih
}
 
enum  PermutedOrder {
  ABCD = 0, BACD = 1, ABDC = 2, BADC = 3,
  CDAB = 4, CDBA = 5, DCAB = 6, DCBA = 7
}
 
enum  ReferenceType { AllRefs, UniqueRefs, ClosedShellRefs, UniqueOpenShellRefs }
 
enum  Timer_Status { OFF, ON, PARALLEL }
 
enum  PsiReturnType { Success, Failure, Balk, EndLoop }
 

Functions

int read_options (const std::string &name, Options &options, bool suppress_printing=false)
 
void create_new_plugin (std::string name, const std::string &template_name)
 
void create_new_plugin_makefile ()
 
template<class T >
bool from_string (T &t, const std::string &s, std::ios_base &(*f)(std::ios_base &))
 
double ** block_matrix (size_t n, size_t m, bool memlock)
 
void free_block (double **array)
 
void eigout (double **a, double *b, double *c, int m, int n, std::string out)
 
void eigsort (double *d, double **v, int n)
 
void mosort (double *d, double **v, int *sym, int nso, int nmo)
 
void eivout (double **a, double *b, int m, int n, std::string out)
 
void ludcmp (double **, int, int *, double *)
 
void lubksb (double **, int, int *, double *)
 
void flin (double **a, double *b, int in, int im, double *det)
 
double * init_array (size_t size)
 
double ** init_matrix (size_t n, size_t m)
 
void free_matrix (double **array, size_t)
 
int * init_int_array (int size)
 
void zero_int_array (int *a, int size)
 
int ** init_int_matrix (int rows, int cols)
 
void free_int_matrix (int **array)
 
void zero_int_matrix (int **array, int rows, int cols)
 
void print_int_mat (int **a, int m, int n, std::string out)
 
int psi_start (FILE **infile, FILE **outfile, char **psi_file_prefix, int argc, char *argv[], int overwrite_output)
 
int psi_stop (FILE *infile, FILE *outfile, char *psi_file_prefix)
 
char * psi_ifname ()
 
char * psi_ofname ()
 
char * psi_fprefix ()
 
void balance (double **a, int n)
 
void mat_to_arr (double **a, double *b, int m, int n)
 
void arr_to_mat (double **a, double *b, int m, int n)
 
void print_array (double *a, int m, std::string out)
 
void print_mat (double **a, int rows, int cols, std::string out)
 
void rsp (int nm, int n, int nv, double *array, double *evals, int matz, double **evecs, double toler)
 
void sq_rsp (int nm, int n, double **array, double *evals, int matz, double **evecs, double toler)
 
void sq_to_tri (double **bmat, double *amat, int size)
 
void tri_to_block (double *a, double **b, int num_ir, int *num_so, int *ioff)
 
void block_to_tri (double *a, double **b, int num_ir, int *num_so, int *ioff)
 
void tri_to_sq (double *amat, double **bmat, int size)
 
void tstart ()
 
void tstop ()
 
void zero_arr (double *a, int size)
 
void zero_mat (double **a, int rows, int cols)
 
long int * init_long_int_array (int size)
 
void zero_long_int_array (long int *a, int size)
 
long int ** init_long_int_matrix (int rows, int cols)
 
void free_long_int_matrix (long int **array)
 
void zero_long_int_matrix (long int **array, int rows, int cols)
 
void print_long_int_mat (long int **a, int m, int n, std::string out)
 
void fndcor (long int *maxcrb, std::string out_fname)
 
void tred2 (int n, double **a, double *d, double *e, int matz)
 
void tqli (int n, double *d, double **z, double *e, int matz, double toler)
 
void * cc3_sigma_RHF_ic_thread (void *thread_data_in)
 
int dpd_set_default (int dpd_num)
 
int dpd_init (int dpd_num, int nirreps, long int memory, int cachetype, int *cachefiles, int **cachelist, dpd_file4_cache_entry *priority, int num_subspaces, std::vector< int * > &spaceArrays)
 
int dpd_close (int dpd_num)
 
long int dpd_memfree (void)
 
void dpd_memset (long int memory)
 
bool operator== (const string &c, const DPDMOSpace &rhs)
 
bool operator== (const char *c, const DPDMOSpace &rhs)
 
std::vector< std::string > dpd_split (const std::string &indices)
 
dpd_file4_cache_entrydpd_file4_cache_find_low (void)
 
static std::string & dpd_ltrim (std::string &s)
 
static std::string & dpd_rtrim (std::string &s)
 
static std::string & dpd_trim (std::string &s)
 
void iwl_buf_close (struct iwlbuf *Buf, int keep)
 
void iwl_buf_fetch (struct iwlbuf *Buf)
 
void iwl_buf_flush (struct iwlbuf *Buf, int lastbuf)
 
void iwl_buf_init (struct iwlbuf *Buf, int itape, double cutoff, int oldfile, int readflag)
 
void iwl_buf_put (struct iwlbuf *Buf)
 
void iwl_buf_wrt_val (struct iwlbuf *Buf, int p, int q, int r, int s, double value, int printflag, std::string out, int dirac)
 
int iwl_rdone (int itap, const char *label, double *ints, int ntri, int erase, int printflg, std::string out)
 
void benchmark_blas1 (int N, double min_time)
 
void benchmark_blas2 (int N, double min_time)
 
void benchmark_blas3 (int N, double min_time, int max_threads)
 
void benchmark_disk (int N, double min_time)
 
void benchmark_math (double min_time)
 
void benchmark_integrals (int max_am, double min_time)
 
bool operator== (const Dimension &a, const Dimension &b)
 
bool operator!= (const Dimension &a, const Dimension &b)
 
Dimension operator+ (const Dimension &a, const Dimension &b)
 
Dimension operator- (const Dimension &a, const Dimension &b)
 
static TwoIndex< double > realSphericalHarmonics (int lmax, double x, double phi)
 
static TwoIndex< double > realSphericalHarmonics (int lmax, double x, double phi)
 
std::string get_writer_file_prefix (const std::string &molecule_name)
 
int str_to_int (const std::string &s)
 
double str_to_double (const std::string &s)
 
void set_block (Slice rows, Slice cols, SharedMatrix block)
 
std::regex realNumber_ ("(?:[-+]?\\d*\\.\\d+(?:[DdEe][-+]?\\d+)?)|(?:[-+]?\\d+\\.\\d*(?:[DdEe][-+]?\\d+)?)|(?:[-+]?\\d+(?:[DdEe][-+]?\\d+)?)", std::regex_constants::icase)
 
std::regex integerNumber_ ("(-?\\d+)", std::regex_constants::icase)
 
std::regex atomSymbol_ ("(([A-Z]{1,3})(?:(_\\w+)|(\\d+))?(?:@(\\d+\\.\\d+))?)", std::regex_constants::icase)
 
std::regex variableDefinition_ ("\\s*(\\w+)\\s*=\\s*((-?\\d+\\.\\d+)|(-?\\d+\\.)|(-?\\.\\d+)|(-?\\d+)|(tda))\\s*", std::regex_constants::icase)
 
std::regex blankLine_ ("[\\s%]*", std::regex_constants::icase)
 
std::regex commentLine_ ("\\s*[#%].*", std::regex_constants::icase)
 
std::regex unitLabel_ ("(\\s*(?:units?)[\\s=]+)((angstrom)|(ang)|(bohr)|(au)|(a\\.u\\.))\\s*", std::regex_constants::icase)
 
std::regex chargeAndMultiplicity_ ("\\s*(-?\\d+)\\s+(\\d+)\\s*")
 
std::regex fragmentMarker_ ("\\s*--\\s*")
 
std::regex orientCommand_ ("\\s*no_?reorient\\s*", std::regex_constants::icase)
 
std::regex comCommand_ ("\\s*no_?com\\s*", std::regex_constants::icase)
 
std::regex symmetry_ ("\\s*symmetry[\\s=]+(\\w+)\\s*", std::regex_constants::icase)
 
std::regex pubchemError_ ("\\s*PubchemError\\s*", std::regex_constants::icase)
 
std::regex pubchemInput_ ("\\s*PubchemInput\\s*", std::regex_constants::icase)
 
std::regex ghostAtom_ ("@(.*)|Gh\\((.*)\\)", std::regex_constants::icase)
 
std::regex efpFileMarker_ ("\\s*efp\\s*(\\w+)\\s*", std::regex_constants::icase)
 
std::regex efpAtomSymbol_ ("A\\d*([A-Z]{1,2})\\d*", std::regex_constants::icase)
 
void if_to_invert_axis (const Vector3 &v1, int &must_invert, int &should_invert, double &maxproj)
 
static AxisName like_world_axis (Vector3 &axis, const Vector3 &worldxaxis, const Vector3 &worldyaxis, const Vector3 &worldzaxis)
 
int matrix_3d_rotation_Cn (Matrix &coord, Vector3 axis, bool reflect, double TOL, int max_Cn_to_check=-1)
 
bool atom_present_in_geom (Matrix &geom, Vector3 &b, double tol)
 
int ** compute_shell_map (int **atom_map, const std::shared_ptr< BasisSet > &basis)
 
void delete_shell_map (int **shell_map, const std::shared_ptr< BasisSet > &basis)
 
int64_t ij_offset64 (int64_t i, int64_t j)
 
int64_t i_offset64 (int64_t i)
 
void PSI_DGBMV (int irrep, char trans, int m, int n, int kl, int ku, double alpha, SharedMatrix a, int lda, std::shared_ptr< Vector > x, int incx, double beta, std::shared_ptr< Vector > y, int incy)
 PSI_DGBMV, a wrapper to C_DGBMV using objects. More...
 
void PSI_DGEMM (int irrep, char transa, char transb, int m, int n, int k, double alpha, SharedMatrix a, int lda, SharedMatrix b, int ldb, double beta, SharedMatrix c, int ldc)
 PSI_DGEMM, a wrapper to C_DGEMM using objects. More...
 
void PSI_DGEMV (int irrep, char trans, int m, int n, double alpha, SharedMatrix a, int lda, std::shared_ptr< Vector > x, int incx, double beta, std::shared_ptr< Vector > y, int incy)
 PSI_DGEMV, a wrapper to C_DGEMV using objects. More...
 
void PSI_DGER (int irrep, int m, int n, double alpha, std::shared_ptr< Vector > x, int incx, std::shared_ptr< Vector > y, int incy, SharedMatrix a, int lda)
 PSI_DGER, a wrapper to C_DGER using objects. More...
 
void PSI_DSBMV (int irrep, char uplo, int n, int k, double alpha, SharedMatrix a, int lda, std::shared_ptr< Vector > x, int incx, double beta, std::shared_ptr< Vector > y, int incy)
 PSI_DSBMV, a wrapper to C_DSBMV using objects. More...
 
void PSI_DSYMM (int irrep, char side, char uplo, int m, int n, double alpha, SharedMatrix a, int lda, SharedMatrix b, int ldb, double beta, SharedMatrix c, int ldc)
 PSI_DSYMM, a wrapper to C_DSYMM using objects. More...
 
void PSI_DSYMV (int irrep, char uplo, int n, double alpha, SharedMatrix a, int lda, std::shared_ptr< Vector > x, int incx, double beta, std::shared_ptr< Vector > y, int incy)
 PSI_DSYMV, a wrapper to C_DSYMV using objects. More...
 
void PSI_DSYR (int irrep, char uplo, int n, double alpha, std::shared_ptr< Vector > x, int incx, SharedMatrix a, int lda)
 PSI_DSYR, a wrapper to C_DSYR using objects. More...
 
void PSI_DSYR2 (int irrep, char uplo, int n, double alpha, std::shared_ptr< Vector > x, int incx, std::shared_ptr< Vector > y, int incy, SharedMatrix a, int lda)
 PSI_DSYR2, a wrapper to C_DSYR2 using objects. More...
 
void PSI_DSYR2K (int irrep, char uplo, char trans, int n, int k, double alpha, SharedMatrix a, int lda, SharedMatrix b, int ldb, double beta, SharedMatrix c, int ldc)
 PSI_DSYR2K, a wrapper to C_DSYR2K using objects. More...
 
void PSI_DSYRK (int irrep, char uplo, char trans, int n, int k, double alpha, SharedMatrix a, int lda, double beta, SharedMatrix c, int ldc)
 PSI_DSYRK, a wrapper to C_DSYRK using objects. More...
 
void PSI_DTBMV (int irrep, char uplo, char trans, char diag, int n, int k, SharedMatrix a, int lda, std::shared_ptr< Vector > x, int incx)
 PSI_DTBMV, a wrapper to C_DTBMV using objects. More...
 
void PSI_DTBSV (int irrep, char uplo, char trans, char diag, int n, int k, SharedMatrix a, int lda, std::shared_ptr< Vector > x, int incx)
 PSI_DTBSV, a wrapper to C_DTBSV using objects. More...
 
void PSI_DTRMM (int irrep, char side, char uplo, char transa, char diag, int m, int n, double alpha, SharedMatrix a, int lda, SharedMatrix b, int ldb)
 PSI_DTRMM, a wrapper to C_DTRMM using objects. More...
 
void PSI_DTRMV (int irrep, char uplo, char trans, char diag, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > x, int incx)
 PSI_DTRMV, a wrapper to C_DTRMV using objects. More...
 
void PSI_DTRSM (int irrep, char side, char uplo, char transa, char diag, int m, int n, double alpha, SharedMatrix a, int lda, SharedMatrix b, int ldb)
 PSI_DTRSM, a wrapper to C_DTRSM using objects. More...
 
void PSI_DTRSV (int irrep, char uplo, char trans, char diag, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > x, int incx)
 PSI_DTRSV, a wrapper to C_DTRSV using objects. More...
 
void PSI_DROT (int irrep, size_t n, std::shared_ptr< Vector > x, int incx, std::shared_ptr< Vector > y, int incy, double c, double s)
 PSI_DROT, a wrapper to C_DROT using objects. More...
 
void PSI_DSWAP (int irrep, size_t n, std::shared_ptr< Vector > x, int incx, std::shared_ptr< Vector > y, int incy)
 PSI_DSWAP, a wrapper to C_DSWAP using objects. More...
 
void PSI_DCOPY (int irrep, size_t n, std::shared_ptr< Vector > x, int incx, std::shared_ptr< Vector > y, int incy)
 PSI_DCOPY, a wrapper to C_DCOPY using objects. More...
 
void PSI_DSCAL (int irrep, size_t n, double alpha, std::shared_ptr< Vector > x, int incx)
 PSI_DSCAL, a wrapper to C_DSCAL using objects. More...
 
void PSI_DAXPY (int irrep, size_t n, double alpha, std::shared_ptr< Vector > x, int incx, std::shared_ptr< Vector > y, int incy)
 PSI_DAXPY, a wrapper to C_DAXPY using objects. More...
 
double PSI_DDOT (int irrep, size_t n, std::shared_ptr< Vector > x, int incx, std::shared_ptr< Vector > y, int incy)
 PSI_DDOT, a wrapper to C_DDOT using objects. More...
 
double PSI_DNRM2 (int irrep, size_t n, std::shared_ptr< Vector > x, int incx)
 PSI_DNRM2, a wrapper to C_DNRM2 using objects. More...
 
double PSI_DASUM (int irrep, size_t n, std::shared_ptr< Vector > x, int incx)
 PSI_DASUM, a wrapper to C_DASUM using objects. More...
 
size_t PSI_IDAMAX (int irrep, size_t n, std::shared_ptr< Vector > x, int incx)
 PSI_IDAMAX, a wrapper to C_IDAMAX using objects. More...
 
int PSI_DBDSDC (int irrep, char uplo, char compq, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix u, int ldu, SharedMatrix vt, int ldvt, std::shared_ptr< Vector > q, std::shared_ptr< IntVector > iq, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 
int PSI_DBDSQR (int irrep, char uplo, int n, int ncvt, int nru, int ncc, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix vt, int ldvt, SharedMatrix u, int ldu, SharedMatrix c, int ldc, std::shared_ptr< Vector > work)
 PSI_DBDSQR, a wrapper to return C_DBDSQR using objects. More...
 
int PSI_DDISNA (int irrep, char job, int m, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > sep)
 PSI_DDISNA, a wrapper to return C_DDISNA using objects. More...
 
int PSI_DGBBRD (int irrep, char vect, int m, int n, int ncc, int kl, int ku, SharedMatrix ab, int ldab, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix q, int ldq, SharedMatrix pt, int ldpt, SharedMatrix c, int ldc, std::shared_ptr< Vector > work)
 PSI_DGBBRD, a wrapper to return C_DGBBRD using objects. More...
 
int PSI_DGBCON (int irrep, char norm, int n, int kl, int ku, SharedMatrix ab, int ldab, std::shared_ptr< IntVector > ipiv, double anorm, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DGBCON, a wrapper to return C_DGBCON using objects. More...
 
int PSI_DGBEQU (int irrep, int m, int n, int kl, int ku, SharedMatrix ab, int ldab, std::shared_ptr< Vector > r, std::shared_ptr< Vector > c, std::shared_ptr< Vector > rowcnd, std::shared_ptr< Vector > colcnd, std::shared_ptr< Vector > amax)
 PSI_DGBEQU, a wrapper to return C_DGBEQU using objects. More...
 
int PSI_DGBRFS (int irrep, char trans, int n, int kl, int ku, int nrhs, SharedMatrix ab, int ldab, SharedMatrix afb, int ldafb, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DGBRFS, a wrapper to return C_DGBRFS using objects. More...
 
int PSI_DGBSV (int irrep, int n, int kl, int ku, int nrhs, SharedMatrix ab, int ldab, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb)
 PSI_DGBSV, a wrapper to return C_DGBSV using objects. More...
 
int PSI_DGBSVX (int irrep, char fact, char trans, int n, int kl, int ku, int nrhs, SharedMatrix ab, int ldab, SharedMatrix afb, int ldafb, std::shared_ptr< IntVector > ipiv, char equed, std::shared_ptr< Vector > r, std::shared_ptr< Vector > c, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DGBSVX, a wrapper to return C_DGBSVX using objects. More...
 
int PSI_DGBTRF (int irrep, int m, int n, int kl, int ku, SharedMatrix ab, int ldab, std::shared_ptr< IntVector > ipiv)
 PSI_DGBTRF, a wrapper to return C_DGBTRF using objects. More...
 
int PSI_DGBTRS (int irrep, char trans, int n, int kl, int ku, int nrhs, SharedMatrix ab, int ldab, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb)
 PSI_DGBTRS, a wrapper to return C_DGBTRS using objects. More...
 
int PSI_DGEBAK (int irrep, char job, char side, int n, int ilo, int ihi, std::shared_ptr< Vector > scale, int m, SharedMatrix v, int ldv)
 PSI_DGEBAK, a wrapper to return C_DGEBAK using objects. More...
 
int PSI_DGEBAL (int irrep, char job, int n, SharedMatrix a, int lda, std::shared_ptr< IntVector > ilo, std::shared_ptr< IntVector > ihi, std::shared_ptr< Vector > scale)
 PSI_DGEBAL, a wrapper to return C_DGEBAL using objects. More...
 
int PSI_DGEBRD (int irrep, int m, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, std::shared_ptr< Vector > tauq, std::shared_ptr< Vector > taup, std::shared_ptr< Vector > work, int lwork)
 PSI_DGEBRD, a wrapper to return C_DGEBRD using objects. More...
 
int PSI_DGECON (int irrep, char norm, int n, SharedMatrix a, int lda, double anorm, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DGECON, a wrapper to return C_DGECON using objects. More...
 
int PSI_DGEEQU (int irrep, int m, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > r, std::shared_ptr< Vector > c, std::shared_ptr< Vector > rowcnd, std::shared_ptr< Vector > colcnd, std::shared_ptr< Vector > amax)
 PSI_DGEEQU, a wrapper to return C_DGEEQU using objects. More...
 
int PSI_DGEES (int irrep, char jobvs, char sort, int n, SharedMatrix a, int lda, std::shared_ptr< IntVector > sdim, std::shared_ptr< Vector > wr, std::shared_ptr< Vector > wi, SharedMatrix vs, int ldvs, std::shared_ptr< Vector > work, int lwork)
 PSI_DGEES, a wrapper to return C_DGEES using objects. More...
 
int PSI_DGEESX (int irrep, char jobvs, char sort, char sense, int n, SharedMatrix a, int lda, std::shared_ptr< IntVector > sdim, std::shared_ptr< Vector > wr, std::shared_ptr< Vector > wi, SharedMatrix vs, int ldvs, std::shared_ptr< Vector > rconde, std::shared_ptr< Vector > rcondv, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DGEESX, a wrapper to return C_DGEESX using objects. More...
 
int PSI_DGEEV (int irrep, char jobvl, char jobvr, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > wr, std::shared_ptr< Vector > wi, SharedMatrix vl, int ldvl, SharedMatrix vr, int ldvr, std::shared_ptr< Vector > work, int lwork)
 PSI_DGEEV, a wrapper to return C_DGEEV using objects. More...
 
int PSI_DGEEVX (int irrep, char balanc, char jobvl, char jobvr, char sense, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > wr, std::shared_ptr< Vector > wi, SharedMatrix vl, int ldvl, SharedMatrix vr, int ldvr, std::shared_ptr< IntVector > ilo, std::shared_ptr< IntVector > ihi, std::shared_ptr< Vector > scale, std::shared_ptr< Vector > abnrm, std::shared_ptr< Vector > rconde, std::shared_ptr< Vector > rcondv, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork)
 PSI_DGEEVX, a wrapper to return C_DGEEVX using objects. More...
 
int PSI_DGEGS (int irrep, char jobvsl, char jobvsr, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > alphar, std::shared_ptr< Vector > alphai, std::shared_ptr< Vector > beta, SharedMatrix vsl, int ldvsl, SharedMatrix vsr, int ldvsr, std::shared_ptr< Vector > work, int lwork)
 PSI_DGEGS, a wrapper to return C_DGEGS using objects. More...
 
int PSI_DGEGV (int irrep, char jobvl, char jobvr, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > alphar, std::shared_ptr< Vector > alphai, std::shared_ptr< Vector > beta, SharedMatrix vl, int ldvl, SharedMatrix vr, int ldvr, std::shared_ptr< Vector > work, int lwork)
 PSI_DGEGV, a wrapper to return C_DGEGV using objects. More...
 
int PSI_DGEHRD (int irrep, int n, int ilo, int ihi, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DGEHRD, a wrapper to return C_DGEHRD using objects. More...
 
int PSI_DGELQF (int irrep, int m, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DGELQF, a wrapper to return C_DGELQF using objects. More...
 
int PSI_DGELS (int irrep, char trans, int m, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > work, int lwork)
 PSI_DGELS, a wrapper to return C_DGELS using objects. More...
 
int PSI_DGELSD (int irrep, int m, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > s, double rcond, std::shared_ptr< IntVector > rank, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork)
 PSI_DGELSD, a wrapper to return C_DGELSD using objects. More...
 
int PSI_DGELSS (int irrep, int m, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > s, double rcond, std::shared_ptr< IntVector > rank, std::shared_ptr< Vector > work, int lwork)
 PSI_DGELSS, a wrapper to return C_DGELSS using objects. More...
 
int PSI_DGELSX (int irrep, int m, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< IntVector > jpvt, double rcond, std::shared_ptr< IntVector > rank, std::shared_ptr< Vector > work)
 PSI_DGELSX, a wrapper to return C_DGELSX using objects. More...
 
int PSI_DGELSY (int irrep, int m, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< IntVector > jpvt, double rcond, std::shared_ptr< IntVector > rank, std::shared_ptr< Vector > work, int lwork)
 PSI_DGELSY, a wrapper to return C_DGELSY using objects. More...
 
int PSI_DGEQLF (int irrep, int m, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DGEQLF, a wrapper to return C_DGEQLF using objects. More...
 
int PSI_DGEQP3 (int irrep, int m, int n, SharedMatrix a, int lda, std::shared_ptr< IntVector > jpvt, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DGEQP3, a wrapper to return C_DGEQP3 using objects. More...
 
int PSI_DGEQPF (int irrep, int m, int n, SharedMatrix a, int lda, std::shared_ptr< IntVector > jpvt, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work)
 PSI_DGEQPF, a wrapper to return C_DGEQPF using objects. More...
 
int PSI_DGERFS (int irrep, char trans, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix af, int ldaf, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DGERFS, a wrapper to return C_DGERFS using objects. More...
 
int PSI_DGERQF (int irrep, int m, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DGERQF, a wrapper to return C_DGERQF using objects. More...
 
int PSI_DGESDD (int irrep, char jobz, int m, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > s, SharedMatrix u, int ldu, SharedMatrix vt, int ldvt, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork)
 PSI_DGESDD, a wrapper to return C_DGESDD using objects. More...
 
int PSI_DGESV (int irrep, int n, int nrhs, SharedMatrix a, int lda, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb)
 PSI_DGESV, a wrapper to return C_DGESV using objects. More...
 
int PSI_DGESVX (int irrep, char fact, char trans, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix af, int ldaf, std::shared_ptr< IntVector > ipiv, char equed, std::shared_ptr< Vector > r, std::shared_ptr< Vector > c, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DGESVX, a wrapper to return C_DGESVX using objects. More...
 
int PSI_DGETRF (int irrep, int m, int n, SharedMatrix a, int lda, std::shared_ptr< IntVector > ipiv)
 PSI_DGETRF, a wrapper to return C_DGETRF using objects. More...
 
int PSI_DGETRI (int irrep, int n, SharedMatrix a, int lda, std::shared_ptr< IntVector > ipiv, std::shared_ptr< Vector > work, int lwork)
 PSI_DGETRI, a wrapper to return C_DGETRI using objects. More...
 
int PSI_DGETRS (int irrep, char trans, int n, int nrhs, SharedMatrix a, int lda, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb)
 PSI_DGETRS, a wrapper to return C_DGETRS using objects. More...
 
int PSI_DGGBAK (int irrep, char job, char side, int n, int ilo, int ihi, std::shared_ptr< Vector > lscale, std::shared_ptr< Vector > rscale, int m, SharedMatrix v, int ldv)
 PSI_DGGBAK, a wrapper to return C_DGGBAK using objects. More...
 
int PSI_DGGBAL (int irrep, char job, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< IntVector > ilo, std::shared_ptr< IntVector > ihi, std::shared_ptr< Vector > lscale, std::shared_ptr< Vector > rscale, std::shared_ptr< Vector > work)
 PSI_DGGBAL, a wrapper to return C_DGGBAL using objects. More...
 
int PSI_DGGES (int irrep, char jobvsl, char jobvsr, char sort, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< IntVector > sdim, std::shared_ptr< Vector > alphar, std::shared_ptr< Vector > alphai, std::shared_ptr< Vector > beta, SharedMatrix vsl, int ldvsl, SharedMatrix vsr, int ldvsr, std::shared_ptr< Vector > work, int lwork)
 PSI_DGGES, a wrapper to return C_DGGES using objects. More...
 
int PSI_DGGESX (int irrep, char jobvsl, char jobvsr, char sort, char sense, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< IntVector > sdim, std::shared_ptr< Vector > alphar, std::shared_ptr< Vector > alphai, std::shared_ptr< Vector > beta, SharedMatrix vsl, int ldvsl, SharedMatrix vsr, int ldvsr, std::shared_ptr< Vector > rconde, std::shared_ptr< Vector > rcondv, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DGGESX, a wrapper to return C_DGGESX using objects. More...
 
int PSI_DGGEV (int irrep, char jobvl, char jobvr, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > alphar, std::shared_ptr< Vector > alphai, std::shared_ptr< Vector > beta, SharedMatrix vl, int ldvl, SharedMatrix vr, int ldvr, std::shared_ptr< Vector > work, int lwork)
 PSI_DGGEV, a wrapper to return C_DGGEV using objects. More...
 
int PSI_DGGEVX (int irrep, char balanc, char jobvl, char jobvr, char sense, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > alphar, std::shared_ptr< Vector > alphai, std::shared_ptr< Vector > beta, SharedMatrix vl, int ldvl, SharedMatrix vr, int ldvr, std::shared_ptr< IntVector > ilo, std::shared_ptr< IntVector > ihi, std::shared_ptr< Vector > lscale, std::shared_ptr< Vector > rscale, std::shared_ptr< Vector > abnrm, std::shared_ptr< Vector > bbnrm, std::shared_ptr< Vector > rconde, std::shared_ptr< Vector > rcondv, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork)
 PSI_DGGEVX, a wrapper to return C_DGGEVX using objects. More...
 
int PSI_DGGGLM (int irrep, int n, int m, int p, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > d, std::shared_ptr< Vector > x, std::shared_ptr< Vector > y, std::shared_ptr< Vector > work, int lwork)
 PSI_DGGGLM, a wrapper to return C_DGGGLM using objects. More...
 
int PSI_DGGHRD (int irrep, char compq, char compz, int n, int ilo, int ihi, SharedMatrix a, int lda, SharedMatrix b, int ldb, SharedMatrix q, int ldq, SharedMatrix z, int ldz)
 PSI_DGGHRD, a wrapper to return C_DGGHRD using objects. More...
 
int PSI_DGGLSE (int irrep, int m, int n, int p, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > c, std::shared_ptr< Vector > d, std::shared_ptr< Vector > x, std::shared_ptr< Vector > work, int lwork)
 PSI_DGGLSE, a wrapper to return C_DGGLSE using objects. More...
 
int PSI_DGGQRF (int irrep, int n, int m, int p, SharedMatrix a, int lda, std::shared_ptr< Vector > taua, SharedMatrix b, int ldb, std::shared_ptr< Vector > taub, std::shared_ptr< Vector > work, int lwork)
 PSI_DGGQRF, a wrapper to return C_DGGQRF using objects. More...
 
int PSI_DGGRQF (int irrep, int m, int p, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > taua, SharedMatrix b, int ldb, std::shared_ptr< Vector > taub, std::shared_ptr< Vector > work, int lwork)
 PSI_DGGRQF, a wrapper to return C_DGGRQF using objects. More...
 
int PSI_DGGSVD (int irrep, char jobu, char jobv, char jobq, int m, int n, int p, std::shared_ptr< IntVector > k, std::shared_ptr< IntVector > l, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > alpha, std::shared_ptr< Vector > beta, SharedMatrix u, int ldu, SharedMatrix v, int ldv, SharedMatrix q, int ldq, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DGGSVD, a wrapper to return C_DGGSVD using objects. More...
 
int PSI_DGGSVP (int irrep, char jobu, char jobv, char jobq, int m, int p, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, double tola, double tolb, std::shared_ptr< IntVector > k, std::shared_ptr< IntVector > l, SharedMatrix u, int ldu, SharedMatrix v, int ldv, SharedMatrix q, int ldq, std::shared_ptr< IntVector > iwork, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work)
 PSI_DGGSVP, a wrapper to return C_DGGSVP using objects. More...
 
int PSI_DGTCON (int irrep, char norm, int n, std::shared_ptr< Vector > dl, std::shared_ptr< Vector > d, std::shared_ptr< Vector > du, std::shared_ptr< Vector > du2, std::shared_ptr< IntVector > ipiv, double anorm, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DGTCON, a wrapper to return C_DGTCON using objects. More...
 
int PSI_DGTRFS (int irrep, char trans, int n, int nrhs, std::shared_ptr< Vector > dl, std::shared_ptr< Vector > d, std::shared_ptr< Vector > du, std::shared_ptr< Vector > dlf, std::shared_ptr< Vector > df, std::shared_ptr< Vector > duf, std::shared_ptr< Vector > du2, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DGTRFS, a wrapper to return C_DGTRFS using objects. More...
 
int PSI_DGTSV (int irrep, int n, int nrhs, std::shared_ptr< Vector > dl, std::shared_ptr< Vector > d, std::shared_ptr< Vector > du, SharedMatrix b, int ldb)
 PSI_DGTSV, a wrapper to return C_DGTSV using objects. More...
 
int PSI_DGTSVX (int irrep, char fact, char trans, int n, int nrhs, std::shared_ptr< Vector > dl, std::shared_ptr< Vector > d, std::shared_ptr< Vector > du, std::shared_ptr< Vector > dlf, std::shared_ptr< Vector > df, std::shared_ptr< Vector > duf, std::shared_ptr< Vector > du2, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > rcond)
 PSI_DGTSVX, a wrapper to return C_DGTSVX using objects. More...
 
int PSI_DGTTRF (int irrep, int n, std::shared_ptr< Vector > dl, std::shared_ptr< Vector > d, std::shared_ptr< Vector > du, std::shared_ptr< Vector > du2, std::shared_ptr< IntVector > ipiv)
 PSI_DGTTRF, a wrapper to return C_DGTTRF using objects. More...
 
int PSI_DGTTRS (int irrep, char trans, int n, int nrhs, std::shared_ptr< Vector > dl, std::shared_ptr< Vector > d, std::shared_ptr< Vector > du, std::shared_ptr< Vector > du2, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb)
 PSI_DGTTRS, a wrapper to return C_DGTTRS using objects. More...
 
int PSI_DHGEQZ (int irrep, char job, char compq, char compz, int n, int ilo, int ihi, SharedMatrix h, int ldh, SharedMatrix t, int ldt, std::shared_ptr< Vector > alphar, std::shared_ptr< Vector > alphai, std::shared_ptr< Vector > beta, SharedMatrix q, int ldq, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, int lwork)
 PSI_DHGEQZ, a wrapper to return C_DHGEQZ using objects. More...
 
int PSI_DHSEIN (int irrep, char side, char eigsrc, char initv, int n, SharedMatrix h, int ldh, std::shared_ptr< Vector > wr, std::shared_ptr< Vector > wi, SharedMatrix vl, int ldvl, SharedMatrix vr, int ldvr, int mm, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > ifaill, std::shared_ptr< IntVector > ifailr)
 PSI_DHSEIN, a wrapper to return C_DHSEIN using objects. More...
 
int PSI_DHSEQR (int irrep, char job, char compz, int n, int ilo, int ihi, SharedMatrix h, int ldh, std::shared_ptr< Vector > wr, std::shared_ptr< Vector > wi, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, int lwork)
 PSI_DHSEQR, a wrapper to return C_DHSEQR using objects. More...
 
int PSI_DORGBR (int irrep, char vect, int m, int n, int k, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DORGBR, a wrapper to return C_DORGBR using objects. More...
 
int PSI_DORGHR (int irrep, int n, int ilo, int ihi, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DORGHR, a wrapper to return C_DORGHR using objects. More...
 
int PSI_DORGLQ (int irrep, int m, int n, int k, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DORGLQ, a wrapper to return C_DORGLQ using objects. More...
 
int PSI_DORGQL (int irrep, int m, int n, int k, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DORGQL, a wrapper to return C_DORGQL using objects. More...
 
int PSI_DORGQR (int irrep, int m, int n, int k, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DORGQR, a wrapper to return C_DORGQR using objects. More...
 
int PSI_DORGRQ (int irrep, int m, int n, int k, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DORGRQ, a wrapper to return C_DORGRQ using objects. More...
 
int PSI_DORGTR (int irrep, char uplo, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DORGTR, a wrapper to return C_DORGTR using objects. More...
 
int PSI_DORMBR (int irrep, char vect, char side, char trans, int m, int n, int k, std::shared_ptr< Vector > a, int lda, std::shared_ptr< Vector > tau, SharedMatrix c, int ldc, std::shared_ptr< Vector > work, int lwork)
 PSI_DORMBR, a wrapper to return C_DORMBR using objects. More...
 
int PSI_DORMHR (int irrep, char side, char trans, int m, int n, int ilo, int ihi, std::shared_ptr< Vector > a, int lda, std::shared_ptr< Vector > tau, SharedMatrix c, int ldc, std::shared_ptr< Vector > work, int lwork)
 PSI_DORMHR, a wrapper to return C_DORMHR using objects. More...
 
int PSI_DORMLQ (int irrep, char side, char trans, int m, int n, int k, std::shared_ptr< Vector > a, int lda, std::shared_ptr< Vector > tau, SharedMatrix c, int ldc, std::shared_ptr< Vector > work, int lwork)
 PSI_DORMLQ, a wrapper to return C_DORMLQ using objects. More...
 
int PSI_DORMQL (int irrep, char side, char trans, int m, int n, int k, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, SharedMatrix c, int ldc, std::shared_ptr< Vector > work, int lwork)
 PSI_DORMQL, a wrapper to return C_DORMQL using objects. More...
 
int PSI_DORMQR (int irrep, char side, char trans, int m, int n, int k, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, SharedMatrix c, int ldc, std::shared_ptr< Vector > work, int lwork)
 PSI_DORMQR, a wrapper to return C_DORMQR using objects. More...
 
int PSI_DORMR3 (int irrep, char side, char trans, int m, int n, int k, int l, std::shared_ptr< Vector > a, int lda, std::shared_ptr< Vector > tau, SharedMatrix c, int ldc, std::shared_ptr< Vector > work)
 PSI_DORMR3, a wrapper to return C_DORMR3 using objects. More...
 
int PSI_DORMRQ (int irrep, char side, char trans, int m, int n, int k, std::shared_ptr< Vector > a, int lda, std::shared_ptr< Vector > tau, SharedMatrix c, int ldc, std::shared_ptr< Vector > work, int lwork)
 PSI_DORMRQ, a wrapper to return C_DORMRQ using objects. More...
 
int PSI_DORMRZ (int irrep, char side, char trans, int m, int n, int k, int l, std::shared_ptr< Vector > a, int lda, std::shared_ptr< Vector > tau, SharedMatrix c, int ldc, std::shared_ptr< Vector > work, int lwork)
 PSI_DORMRZ, a wrapper to return C_DORMRZ using objects. More...
 
int PSI_DORMTR (int irrep, char side, char uplo, char trans, int m, int n, std::shared_ptr< Vector > a, int lda, std::shared_ptr< Vector > tau, SharedMatrix c, int ldc, std::shared_ptr< Vector > work, int lwork)
 PSI_DORMTR, a wrapper to return C_DORMTR using objects. More...
 
int PSI_DPBCON (int irrep, char uplo, int n, int kd, SharedMatrix ab, int ldab, double anorm, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DPBCON, a wrapper to return C_DPBCON using objects. More...
 
int PSI_DPBEQU (int irrep, char uplo, int n, int kd, SharedMatrix ab, int ldab, std::shared_ptr< Vector > s, std::shared_ptr< Vector > scond, std::shared_ptr< Vector > amax)
 PSI_DPBEQU, a wrapper to return C_DPBEQU using objects. More...
 
int PSI_DPBRFS (int irrep, char uplo, int n, int kd, int nrhs, SharedMatrix ab, int ldab, SharedMatrix afb, int ldafb, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DPBRFS, a wrapper to return C_DPBRFS using objects. More...
 
int PSI_DPBSTF (int irrep, char uplo, int n, int kd, SharedMatrix ab, int ldab)
 PSI_DPBSTF, a wrapper to return C_DPBSTF using objects. More...
 
int PSI_DPBSV (int irrep, char uplo, int n, int kd, int nrhs, SharedMatrix ab, int ldab, SharedMatrix b, int ldb)
 PSI_DPBSV, a wrapper to return C_DPBSV using objects. More...
 
int PSI_DPBSVX (int irrep, char fact, char uplo, int n, int kd, int nrhs, SharedMatrix ab, int ldab, SharedMatrix afb, int ldafb, char equed, std::shared_ptr< Vector > s, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DPBSVX, a wrapper to return C_DPBSVX using objects. More...
 
int PSI_DPBTRF (int irrep, char uplo, int n, int kd, SharedMatrix ab, int ldab)
 PSI_DPBTRF, a wrapper to return C_DPBTRF using objects. More...
 
int PSI_DPBTRS (int irrep, char uplo, int n, int kd, int nrhs, SharedMatrix ab, int ldab, SharedMatrix b, int ldb)
 PSI_DPBTRS, a wrapper to return C_DPBTRS using objects. More...
 
int PSI_DPOCON (int irrep, char uplo, int n, SharedMatrix a, int lda, double anorm, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DPOCON, a wrapper to return C_DPOCON using objects. More...
 
int PSI_DPOEQU (int irrep, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > s, std::shared_ptr< Vector > scond, std::shared_ptr< Vector > amax)
 PSI_DPOEQU, a wrapper to return C_DPOEQU using objects. More...
 
int PSI_DPORFS (int irrep, char uplo, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix af, int ldaf, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DPORFS, a wrapper to return C_DPORFS using objects. More...
 
int PSI_DPOSV (int irrep, char uplo, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix b, int ldb)
 PSI_DPOSV, a wrapper to return C_DPOSV using objects. More...
 
int PSI_DPOSVX (int irrep, char fact, char uplo, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix af, int ldaf, char equed, std::shared_ptr< Vector > s, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DPOSVX, a wrapper to return C_DPOSVX using objects. More...
 
int PSI_DPOTRF (int irrep, char uplo, int n, SharedMatrix a, int lda)
 PSI_DPOTRF, a wrapper to return C_DPOTRF using objects. More...
 
int PSI_DPOTRI (int irrep, char uplo, int n, SharedMatrix a, int lda)
 PSI_DPOTRI, a wrapper to return C_DPOTRI using objects. More...
 
int PSI_DPOTRS (int irrep, char uplo, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix b, int ldb)
 PSI_DPOTRS, a wrapper to return C_DPOTRS using objects. More...
 
int PSI_DPTCON (int irrep, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, double anorm, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > work)
 PSI_DPTCON, a wrapper to return C_DPTCON using objects. More...
 
int PSI_DPTEQR (int irrep, char compz, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix z, int ldz, std::shared_ptr< Vector > work)
 PSI_DPTEQR, a wrapper to return C_DPTEQR using objects. More...
 
int PSI_DPTRFS (int irrep, int n, int nrhs, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, std::shared_ptr< Vector > df, std::shared_ptr< Vector > ef, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work)
 PSI_DPTRFS, a wrapper to return C_DPTRFS using objects. More...
 
int PSI_DPTSV (int irrep, int n, int nrhs, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix b, int ldb)
 PSI_DPTSV, a wrapper to return C_DPTSV using objects. More...
 
int PSI_DPTSVX (int irrep, char fact, int n, int nrhs, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, std::shared_ptr< Vector > df, std::shared_ptr< Vector > ef, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work)
 PSI_DPTSVX, a wrapper to return C_DPTSVX using objects. More...
 
int PSI_DPTTRF (int irrep, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e)
 PSI_DPTTRF, a wrapper to return C_DPTTRF using objects. More...
 
int PSI_DPTTRS (int irrep, int n, int nrhs, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix b, int ldb)
 PSI_DPTTRS, a wrapper to return C_DPTTRS using objects. More...
 
int PSI_DSBEV (int irrep, char jobz, char uplo, int n, int kd, SharedMatrix ab, int ldab, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< Vector > work)
 PSI_DSBEV, a wrapper to return C_DSBEV using objects. More...
 
int PSI_DSBEVD (int irrep, char jobz, char uplo, int n, int kd, SharedMatrix ab, int ldab, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DSBEVD, a wrapper to return C_DSBEVD using objects. More...
 
int PSI_DSBEVX (int irrep, char jobz, char range, char uplo, int n, int kd, SharedMatrix ab, int ldab, SharedMatrix q, int ldq, double vl, double vu, int il, int iu, double abstol, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork, std::shared_ptr< IntVector > ifail)
 PSI_DSBEVX, a wrapper to return C_DSBEVX using objects. More...
 
int PSI_DSBGST (int irrep, char vect, char uplo, int n, int ka, int kb, SharedMatrix ab, int ldab, SharedMatrix bb, int ldbb, SharedMatrix x, int ldx, std::shared_ptr< Vector > work)
 PSI_DSBGST, a wrapper to return C_DSBGST using objects. More...
 
int PSI_DSBGV (int irrep, char jobz, char uplo, int n, int ka, int kb, SharedMatrix ab, int ldab, SharedMatrix bb, int ldbb, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< Vector > work)
 PSI_DSBGV, a wrapper to return C_DSBGV using objects. More...
 
int PSI_DSBGVD (int irrep, char jobz, char uplo, int n, int ka, int kb, SharedMatrix ab, int ldab, SharedMatrix bb, int ldbb, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DSBGVD, a wrapper to return C_DSBGVD using objects. More...
 
int PSI_DSBGVX (int irrep, char jobz, char range, char uplo, int n, int ka, int kb, SharedMatrix ab, int ldab, SharedMatrix bb, int ldbb, SharedMatrix q, int ldq, double vl, double vu, int il, int iu, double abstol, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork, std::shared_ptr< IntVector > ifail)
 PSI_DSBGVX, a wrapper to return C_DSBGVX using objects. More...
 
int PSI_DSBTRD (int irrep, char vect, char uplo, int n, int kd, SharedMatrix ab, int ldab, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix q, int ldq, std::shared_ptr< Vector > work)
 PSI_DSBTRD, a wrapper to return C_DSBTRD using objects. More...
 
int PSI_DSGESV (int irrep, int n, int nrhs, std::shared_ptr< Vector > a, int lda, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb, SharedMatrix x, int ldx, SharedMatrix work, std::shared_ptr< IntVector > iter)
 PSI_DSGESV, a wrapper to return C_DSGESV using objects. More...
 
int PSI_DSTEBZ (int irrep, char range, char order, int n, double vl, double vu, int il, int iu, double abstol, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, std::shared_ptr< IntVector > m, std::shared_ptr< IntVector > nsplit, std::shared_ptr< Vector > w, std::shared_ptr< IntVector > iblock, std::shared_ptr< IntVector > isplit, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DSTEBZ, a wrapper to return C_DSTEBZ using objects. More...
 
int PSI_DSTEDC (int irrep, char compz, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DSTEDC, a wrapper to return C_DSTEDC using objects. More...
 
int PSI_DSTEGR (int irrep, char jobz, char range, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, double vl, double vu, int il, int iu, double abstol, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< IntVector > isuppz, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DSTEGR, a wrapper to return C_DSTEGR using objects. More...
 
int PSI_DSTEIN (int irrep, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, int m, std::shared_ptr< Vector > w, std::shared_ptr< IntVector > iblock, std::shared_ptr< IntVector > isplit, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork, std::shared_ptr< IntVector > ifail)
 PSI_DSTEIN, a wrapper to return C_DSTEIN using objects. More...
 
int PSI_DSTEQR (int irrep, char compz, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix z, int ldz, std::shared_ptr< Vector > work)
 PSI_DSTEQR, a wrapper to return C_DSTEQR using objects. More...
 
int PSI_DSTERF (int irrep, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e)
 PSI_DSTERF, a wrapper to return C_DSTERF using objects. More...
 
int PSI_DSTEV (int irrep, char jobz, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix z, int ldz, std::shared_ptr< Vector > work)
 PSI_DSTEV, a wrapper to return C_DSTEV using objects. More...
 
int PSI_DSTEVD (int irrep, char jobz, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DSTEVD, a wrapper to return C_DSTEVD using objects. More...
 
int PSI_DSTEVR (int irrep, char jobz, char range, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, double vl, double vu, int il, int iu, double abstol, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< IntVector > isuppz, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DSTEVR, a wrapper to return C_DSTEVR using objects. More...
 
int PSI_DSTEVX (int irrep, char jobz, char range, int n, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, double vl, double vu, int il, int iu, double abstol, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork, std::shared_ptr< IntVector > ifail)
 PSI_DSTEVX, a wrapper to return C_DSTEVX using objects. More...
 
int PSI_DSYCON (int irrep, char uplo, int n, SharedMatrix a, int lda, std::shared_ptr< IntVector > ipiv, double anorm, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DSYCON, a wrapper to return C_DSYCON using objects. More...
 
int PSI_DSYEV (int irrep, char jobz, char uplo, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > w, std::shared_ptr< Vector > work, int lwork)
 PSI_DSYEV, a wrapper to return C_DSYEV using objects. More...
 
int PSI_DSYEVD (int irrep, char jobz, char uplo, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > w, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DSYEVD, a wrapper to return C_DSYEVD using objects. More...
 
int PSI_DSYEVR (int irrep, char jobz, char range, char uplo, int n, SharedMatrix a, int lda, double vl, double vu, int il, int iu, double abstol, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< IntVector > isuppz, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DSYEVR, a wrapper to return C_DSYEVR using objects. More...
 
int PSI_DSYEVX (int irrep, char jobz, char range, char uplo, int n, SharedMatrix a, int lda, double vl, double vu, int il, int iu, double abstol, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, std::shared_ptr< IntVector > ifail)
 PSI_DSYEVX, a wrapper to return C_DSYEVX using objects. More...
 
int PSI_DSYGST (int irrep, int itype, char uplo, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb)
 PSI_DSYGST, a wrapper to return C_DSYGST using objects. More...
 
int PSI_DSYGV (int irrep, int itype, char jobz, char uplo, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > w, std::shared_ptr< Vector > work, int lwork)
 PSI_DSYGV, a wrapper to return C_DSYGV using objects. More...
 
int PSI_DSYGVD (int irrep, int itype, char jobz, char uplo, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > w, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DSYGVD, a wrapper to return C_DSYGVD using objects. More...
 
int PSI_DSYGVX (int irrep, int itype, char jobz, char range, char uplo, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, double vl, double vu, int il, int iu, double abstol, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > w, SharedMatrix z, int ldz, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, std::shared_ptr< IntVector > ifail)
 PSI_DSYGVX, a wrapper to return C_DSYGVX using objects. More...
 
int PSI_DSYRFS (int irrep, char uplo, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix af, int ldaf, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DSYRFS, a wrapper to return C_DSYRFS using objects. More...
 
int PSI_DSYSV (int irrep, char uplo, int n, int nrhs, SharedMatrix a, int lda, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb, std::shared_ptr< Vector > work, int lwork)
 PSI_DSYSV, a wrapper to return C_DSYSV using objects. More...
 
int PSI_DSYSVX (int irrep, char fact, char uplo, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix af, int ldaf, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > rcond)
 PSI_DSYSVX, a wrapper to return C_DSYSVX using objects. More...
 
int PSI_DSYTRD (int irrep, char uplo, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > d, std::shared_ptr< Vector > e, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DSYTRD, a wrapper to return C_DSYTRD using objects. More...
 
int PSI_DSYTRF (int irrep, char uplo, int n, SharedMatrix a, int lda, std::shared_ptr< IntVector > ipiv, std::shared_ptr< Vector > work, int lwork)
 PSI_DSYTRF, a wrapper to return C_DSYTRF using objects. More...
 
int PSI_DSYTRI (int irrep, char uplo, int n, SharedMatrix a, int lda, std::shared_ptr< IntVector > ipiv, std::shared_ptr< Vector > work)
 PSI_DSYTRI, a wrapper to return C_DSYTRI using objects. More...
 
int PSI_DSYTRS (int irrep, char uplo, int n, int nrhs, SharedMatrix a, int lda, std::shared_ptr< IntVector > ipiv, SharedMatrix b, int ldb)
 PSI_DSYTRS, a wrapper to return C_DSYTRS using objects. More...
 
int PSI_DTBCON (int irrep, char norm, char uplo, char diag, int n, int kd, SharedMatrix ab, int ldab, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DTBCON, a wrapper to return C_DTBCON using objects. More...
 
int PSI_DTBRFS (int irrep, char uplo, char trans, char diag, int n, int kd, int nrhs, SharedMatrix ab, int ldab, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DTBRFS, a wrapper to return C_DTBRFS using objects. More...
 
int PSI_DTBTRS (int irrep, char uplo, char trans, char diag, int n, int kd, int nrhs, SharedMatrix ab, int ldab, SharedMatrix b, int ldb)
 PSI_DTBTRS, a wrapper to return C_DTBTRS using objects. More...
 
int PSI_DTGEVC (int irrep, char side, char howmny, int n, SharedMatrix s, int lds, SharedMatrix p, int ldp, SharedMatrix vl, int ldvl, SharedMatrix vr, int ldvr, int mm, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > work)
 PSI_DTGEVC, a wrapper to return C_DTGEVC using objects. More...
 
int PSI_DTGEXC (int irrep, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, SharedMatrix q, int ldq, SharedMatrix z, int ldz, std::shared_ptr< IntVector > ifst, std::shared_ptr< IntVector > ilst, std::shared_ptr< Vector > work, int lwork)
 PSI_DTGEXC, a wrapper to return C_DTGEXC using objects. More...
 
int PSI_DTGSEN (int irrep, int ijob, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, std::shared_ptr< Vector > alphar, std::shared_ptr< Vector > alphai, std::shared_ptr< Vector > beta, SharedMatrix q, int ldq, SharedMatrix z, int ldz, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > pl, std::shared_ptr< Vector > pr, std::shared_ptr< Vector > dif, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DTGSEN, a wrapper to return C_DTGSEN using objects. More...
 
int PSI_DTGSJA (int irrep, char jobu, char jobv, char jobq, int m, int p, int n, int k, int l, SharedMatrix a, int lda, SharedMatrix b, int ldb, double tola, double tolb, std::shared_ptr< Vector > alpha, std::shared_ptr< Vector > beta, SharedMatrix u, int ldu, SharedMatrix v, int ldv, SharedMatrix q, int ldq, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > ncycle)
 PSI_DTGSJA, a wrapper to return C_DTGSJA using objects. More...
 
int PSI_DTGSNA (int irrep, char job, char howmny, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, SharedMatrix vl, int ldvl, SharedMatrix vr, int ldvr, std::shared_ptr< Vector > s, std::shared_ptr< Vector > dif, int mm, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork)
 PSI_DTGSNA, a wrapper to return C_DTGSNA using objects. More...
 
int PSI_DTGSYL (int irrep, char trans, int ijob, int m, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, SharedMatrix c, int ldc, SharedMatrix d, int ldd, SharedMatrix e, int lde, SharedMatrix f, int ldf, std::shared_ptr< Vector > dif, std::shared_ptr< Vector > scale, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork)
 PSI_DTGSYL, a wrapper to return C_DTGSYL using objects. More...
 
int PSI_DTRCON (int irrep, char norm, char uplo, char diag, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > rcond, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DTRCON, a wrapper to return C_DTRCON using objects. More...
 
int PSI_DTREVC (int irrep, char side, char howmny, int n, SharedMatrix t, int ldt, SharedMatrix vl, int ldvl, SharedMatrix vr, int ldvr, int mm, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > work)
 PSI_DTREVC, a wrapper to return C_DTREVC using objects. More...
 
int PSI_DTREXC (int irrep, char compq, int n, SharedMatrix t, int ldt, SharedMatrix q, int ldq, std::shared_ptr< IntVector > ifst, std::shared_ptr< IntVector > ilst, std::shared_ptr< Vector > work)
 PSI_DTREXC, a wrapper to return C_DTREXC using objects. More...
 
int PSI_DTRRFS (int irrep, char uplo, char trans, char diag, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix b, int ldb, SharedMatrix x, int ldx, std::shared_ptr< Vector > ferr, std::shared_ptr< Vector > berr, std::shared_ptr< Vector > work, std::shared_ptr< IntVector > iwork)
 PSI_DTRRFS, a wrapper to return C_DTRRFS using objects. More...
 
int PSI_DTRSEN (int irrep, char job, char compq, int n, SharedMatrix t, int ldt, SharedMatrix q, int ldq, std::shared_ptr< Vector > wr, std::shared_ptr< Vector > wi, std::shared_ptr< IntVector > m, std::shared_ptr< Vector > s, std::shared_ptr< Vector > sep, std::shared_ptr< Vector > work, int lwork, std::shared_ptr< IntVector > iwork, int liwork)
 PSI_DTRSEN, a wrapper to return C_DTRSEN using objects. More...
 
int PSI_DTRSNA (int irrep, char job, char howmny, int n, SharedMatrix t, int ldt, SharedMatrix vl, int ldvl, SharedMatrix vr, int ldvr, std::shared_ptr< Vector > s, std::shared_ptr< Vector > sep, int mm, std::shared_ptr< IntVector > m, SharedMatrix work, int ldwork, std::shared_ptr< IntVector > iwork)
 PSI_DTRSNA, a wrapper to return C_DTRSNA using objects. More...
 
int PSI_DTRSYL (int irrep, char trana, char tranb, int isgn, int m, int n, SharedMatrix a, int lda, SharedMatrix b, int ldb, SharedMatrix c, int ldc, std::shared_ptr< Vector > scale)
 PSI_DTRSYL, a wrapper to return C_DTRSYL using objects. More...
 
int PSI_DTRTRI (int irrep, char uplo, char diag, int n, SharedMatrix a, int lda)
 PSI_DTRTRI, a wrapper to return C_DTRTRI using objects. More...
 
int PSI_DTRTRS (int irrep, char uplo, char trans, char diag, int n, int nrhs, SharedMatrix a, int lda, SharedMatrix b, int ldb)
 PSI_DTRTRS, a wrapper to return C_DTRTRS using objects. More...
 
int PSI_DTZRQF (int irrep, int m, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > tau)
 PSI_DTZRQF, a wrapper to return C_DTZRQF using objects. More...
 
int PSI_DTZRZF (int irrep, int m, int n, SharedMatrix a, int lda, std::shared_ptr< Vector > tau, std::shared_ptr< Vector > work, int lwork)
 PSI_DTZRZF, a wrapper to return C_DTZRZF using objects. More...
 
static void shell_vector_deleter_ (ShellVec *mpv)
 
static void multishell_vector_deleter_ (ShellPairVec *mpv)
 
static simint_shell psi_shell_to_simint_ (const GaussianShell &s)
 
static std::shared_ptr< ShellVeccreate_shell_vec_ (const BasisSet &bs)
 
static std::shared_ptr
< ShellPairVec
create_shell_pair_ (const ShellVec &bs1, const ShellVec &bs2)
 
static ShellPairVec create_multi_shellpair_ (const std::vector< ShellPairBlock > &vsh, const ShellVec &shell1, const ShellVec &shell2)
 
static std::shared_ptr
< ShellPairVec
create_shared_multi_shellpair_ (const std::vector< ShellPairBlock > &vsh, const ShellVec &shell1, const ShellVec &shell2)
 
template<typename T >
void swap_index (T &a, T &b)
 
Vector3 operator* (double, const Vector3 &)
 
void plugin_close (const plugin_info &info)
 
plugin_info plugin_load (std::string &plugin_path)
 
void generate_combinations (int n, int k, std::vector< std::vector< int > > &combinations)
 
std::string file_to_string (std::string const &name)
 
bool space (char c)
 
bool not_space (char c)
 
std::vector< std::string > split (const std::string &str)
 
std::vector< std::string > split_indices (const std::string &str)
 
void to_lower (std::string &str)
 
std::string to_lower_copy (const std::string &str)
 
void to_upper (std::string &str)
 
std::string to_upper_copy (const std::string &str)
 
std::string to_string (const int val)
 
std::string to_string (const double val)
 
double to_double (const std::string str)
 
int to_integer (const std::string inString)
 
void append_reference (std::string &str, int reference)
 
std::string add_reference (std::string &str, int reference)
 
std::string find_and_replace (std::string &source, const std::string &target, const std::string &replace)
 
void trim_spaces (std::string &str)
 
template<typename Range1T , typename Range2T >
bool iequals (const Range1T &Input, const Range2T &Test)
 
std::vector< std::string > split (const std::string &input, const std::string &regex)
 
size_t edit_distance (const std::string &s1, const std::string &s2)
 Compute the Levenshtein distance between two strings. More...
 
void generate_combinations (int n, int k, std::vector< std::vector< int >> &combinations)
 
double bytes_to_MiB (size_t n)
 
template<typename T >
double type_to_MiB (size_t n)
 
void die_if_not_converged ()
 
bool opening_square_bracket (char c)
 
bool closing_square_bracket (char c)
 
int psio_close (size_t unit, int keep)
 
int psio_done (void)
 
void psio_error (size_t unit, size_t errval)
 
std::string fullkwd (const char *kwdgrp, const char *kwd, int unit)
 
int psio_set_filescfg_kwd (const char *kwdgrp, const char *kwd, int unit, const char *kwdval)
 
const char * psio_get_filescfg_kwd (const char *kwdgrp, const char *kwd, int unit)
 
psio_address psio_get_address (psio_address start, size_t shift)
 
int psio_get_filename_default (char **name)
 
psio_address psio_get_global_address (psio_address entry_start, psio_address rel_address)
 
size_t psio_get_length (psio_address sadd, psio_address eadd)
 
size_t psio_get_numvols_default (void)
 
int psio_get_volpath_default (size_t volume, char **path)
 
std::string psio_getpid (void)
 
int psio_init (void)
 
int psio_state ()
 
int psio_open (size_t unit, int status)
 
int psio_open_check (size_t unit)
 
int psio_ipv1_config (void)
 
int psio_volseek (psio_vol *vol, size_t page, size_t offset, size_t numvols)
 
psio_address psio_get_entry_end (size_t unit, const char *key)
 
int psio_tocwrite (size_t unit)
 
int psio_tocread (size_t unit)
 
void psio_tocprint (size_t unit, FILE *output)
 
psio_tocentrypsio_tocscan (size_t unit, const char *key)
 
bool psio_tocentry_exists (size_t unit, const char *key)
 
psio_tocentrypsio_toclast (size_t unit)
 
int psio_tocclean (size_t unit, const char *key)
 
int psio_write (size_t unit, const char *key, char *buffer, size_t size, psio_address sadd, psio_address *eadd)
 
int psio_read (size_t unit, const char *key, char *buffer, size_t size, psio_address sadd, psio_address *eadd)
 
int psio_write_entry (size_t unit, const char *key, char *buffer, size_t size)
 
int psio_read_entry (size_t unit, const char *key, char *buffer, size_t size)
 
int psio_write_block (size_t unit, const char *key, char *buffer, size_t blksiz, size_t start_blk, size_t end_blk)
 
int psio_read_block (size_t unit, const char *key, char *buffer, size_t blksiz, size_t start_blk, size_t end_blk)
 
int psio_rw (size_t unit, char *buffer, psio_address address, size_t size, int wrt)
 
int psio_zero_disk (size_t unit, const char *key, size_t rows, size_t cols)
 
size_t psio_rd_toclen (size_t unit)
 
void psio_wt_toclen (size_t unit, size_t toclen)
 
bool psio_tocdel (size_t unit, const char *key)
 
void psio_tocprint (size_t unit)
 
double *** init_3d_array (int p, int q, int r)
 
void free_3d_array (double ***A, int p, int q)
 
void C_DSWAP (size_t length, double *x, int inc_x, double *y, int inc_y)
 
void C_DAXPY (size_t length, double a, double *x, int inc_x, double *y, int inc_y)
 
void C_DCOPY (size_t length, double *x, int inc_x, double *y, int inc_y)
 
void C_DSCAL (size_t length, double alpha, double *vec, int inc)
 
void C_DROT (size_t length, double *x, int inc_x, double *y, int inc_y, double costheta, double sintheta)
 
double C_DDOT (size_t length, double *x, int inc_x, double *y, int inc_y)
 
double C_DNRM2 (size_t length, double *x, int inc_x)
 
double C_DASUM (size_t length, double *x, int inc_x)
 
size_t C_IDAMAX (size_t length, double *x, int inc_x)
 
void C_DGBMV (char trans, int m, int n, int kl, int ku, double alpha, double *a, int lda, double *x, int incx, double beta, double *y, int incy)
 
void C_DGEMM (char transa, char transb, int m, int n, int k, double alpha, double *a, int lda, double *b, int ldb, double beta, double *c, int ldc)
 
void C_DGEMV (char trans, int m, int n, double alpha, double *a, int lda, double *x, int incx, double beta, double *y, int incy)
 
void C_DGER (int m, int n, double alpha, double *x, int incx, double *y, int incy, double *a, int lda)
 
void C_DSBMV (char uplo, int n, int k, double alpha, double *a, int lda, double *x, int incx, double beta, double *y, int incy)
 
void C_DSPMV (char uplo, int n, double alpha, double *ap, double *x, int incx, double beta, double *y, int incy)
 
void C_DSPR (char uplo, int n, double alpha, double *x, int incx, double *ap)
 
void C_DSPR2 (char uplo, int n, double alpha, double *x, int incx, double *y, int incy, double *ap)
 
void C_DSYMM (char side, char uplo, int m, int n, double alpha, double *a, int lda, double *b, int ldb, double beta, double *c, int ldc)
 
void C_DSYMV (char uplo, int n, double alpha, double *a, int lda, double *x, int incx, double beta, double *y, int incy)
 
void C_DSYR (char uplo, int n, double alpha, double *x, int incx, double *a, int lda)
 
void C_DSYR2 (char uplo, int n, double alpha, double *x, int incx, double *y, int incy, double *a, int lda)
 
void C_DSYR2K (char uplo, char trans, int n, int k, double alpha, double *a, int lda, double *b, int ldb, double beta, double *c, int ldc)
 
void C_DSYRK (char uplo, char trans, int n, int k, double alpha, double *a, int lda, double beta, double *c, int ldc)
 
void C_DTBMV (char uplo, char trans, char diag, int n, int k, double *a, int lda, double *x, int incx)
 
void C_DTBSV (char uplo, char trans, char diag, int n, int k, double *a, int lda, double *x, int incx)
 
void C_DTPMV (char uplo, char trans, char diag, int n, double *ap, double *x, int incx)
 
void C_DTPSV (char uplo, char trans, char diag, int n, double *ap, double *x, int incx)
 
void C_DTRMM (char side, char uplo, char transa, char diag, int m, int n, double alpha, double *a, int lda, double *b, int ldb)
 
void C_DTRMV (char uplo, char trans, char diag, int n, double *a, int lda, double *x, int incx)
 
void C_DTRSM (char side, char uplo, char transa, char diag, int m, int n, double alpha, double *a, int lda, double *b, int ldb)
 
void C_DTRSV (char uplo, char trans, char diag, int n, double *a, int lda, double *x, int incx)
 
int cc_excited (const char *wfn)
 
int cc_excited (std::string wfn)
 
int david (double **A, int N, int M, double *eps, double **v, double cutoff, int print)
 
void dirprd_block (double **A, double **B, int rows, int cols)
 
double dot_block (double **A, double **B, int rows, int cols, double alpha)
 
void dx_read (double **V_eff, double *phi_ao, double *phi_so, int nao, int nso, double **u)
 
void compute_delta (double **delta, double x, double y, double z)
 
void dx_write (std::shared_ptr< Wavefunction > wfn, Options &options, double **D)
 
void fill_sym_matrix (double **A, int size)
 
double invert_matrix (double **a, double **y, int N, std::string out)
 
int C_DBDSDC (char uplo, char compq, int n, double *d, double *e, double *u, int ldu, double *vt, int ldvt, double *q, int *iq, double *work, int *iwork)
 
int C_DBDSQR (char uplo, int n, int ncvt, int nru, int ncc, double *d, double *e, double *vt, int ldvt, double *u, int ldu, double *c, int ldc, double *work)
 
int C_DDISNA (char job, int m, int n, double *d, double *sep)
 
int C_DGBBRD (char vect, int m, int n, int ncc, int kl, int ku, double *ab, int ldab, double *d, double *e, double *q, int ldq, double *pt, int ldpt, double *c, int ldc, double *work)
 
int C_DGBCON (char norm, int n, int kl, int ku, double *ab, int ldab, int *ipiv, double anorm, double *rcond, double *work, int *iwork)
 
int C_DGBEQU (int m, int n, int kl, int ku, double *ab, int ldab, double *r, double *c, double *rowcnd, double *colcnd, double *amax)
 
int C_DGBRFS (char trans, int n, int kl, int ku, int nrhs, double *ab, int ldab, double *afb, int ldafb, int *ipiv, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DGBSV (int n, int kl, int ku, int nrhs, double *ab, int ldab, int *ipiv, double *b, int ldb)
 
int C_DGBSVX (char fact, char trans, int n, int kl, int ku, int nrhs, double *ab, int ldab, double *afb, int ldafb, int *ipiv, char equed, double *r, double *c, double *b, int ldb, double *x, int ldx, double *rcond, double *ferr, double *berr, double *work, int *iwork)
 
int C_DGBTRF (int m, int n, int kl, int ku, double *ab, int ldab, int *ipiv)
 
int C_DGBTRS (char trans, int n, int kl, int ku, int nrhs, double *ab, int ldab, int *ipiv, double *b, int ldb)
 
int C_DGEBAK (char job, char side, int n, int ilo, int ihi, double *scale, int m, double *v, int ldv)
 
int C_DGEBAL (char job, int n, double *a, int lda, int *ilo, int *ihi, double *scale)
 
int C_DGEBRD (int m, int n, double *a, int lda, double *d, double *e, double *tauq, double *taup, double *work, int lwork)
 
int C_DGECON (char norm, int n, double *a, int lda, double anorm, double *rcond, double *work, int *iwork)
 
int C_DGEEQU (int m, int n, double *a, int lda, double *r, double *c, double *rowcnd, double *colcnd, double *amax)
 
int C_DGEES (char jobvs, char sort, int n, double *a, int lda, int *sdim, double *wr, double *wi, double *vs, int ldvs, double *work, int lwork)
 
int C_DGEESX (char jobvs, char sort, char sense, int n, double *a, int lda, int *sdim, double *wr, double *wi, double *vs, int ldvs, double *rconde, double *rcondv, double *work, int lwork, int *iwork, int liwork)
 
int C_DGEEV (char jobvl, char jobvr, int n, double *a, int lda, double *wr, double *wi, double *vl, int ldvl, double *vr, int ldvr, double *work, int lwork)
 
int C_DGEEVX (char balanc, char jobvl, char jobvr, char sense, int n, double *a, int lda, double *wr, double *wi, double *vl, int ldvl, double *vr, int ldvr, int *ilo, int *ihi, double *scale, double *abnrm, double *rconde, double *rcondv, double *work, int lwork, int *iwork)
 
int C_DGEGS (char jobvsl, char jobvsr, int n, double *a, int lda, double *b, int ldb, double *alphar, double *alphai, double *beta, double *vsl, int ldvsl, double *vsr, int ldvsr, double *work, int lwork)
 
int C_DGEGV (char jobvl, char jobvr, int n, double *a, int lda, double *b, int ldb, double *alphar, double *alphai, double *beta, double *vl, int ldvl, double *vr, int ldvr, double *work, int lwork)
 
int C_DGEHRD (int n, int ilo, int ihi, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DGELQF (int m, int n, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DGELS (char trans, int m, int n, int nrhs, double *a, int lda, double *b, int ldb, double *work, int lwork)
 
int C_DGELSD (int m, int n, int nrhs, double *a, int lda, double *b, int ldb, double *s, double rcond, int *rank, double *work, int lwork, int *iwork)
 
int C_DGELSS (int m, int n, int nrhs, double *a, int lda, double *b, int ldb, double *s, double rcond, int *rank, double *work, int lwork)
 
int C_DGELSX (int m, int n, int nrhs, double *a, int lda, double *b, int ldb, int *jpvt, double rcond, int *rank, double *work)
 
int C_DGELSY (int m, int n, int nrhs, double *a, int lda, double *b, int ldb, int *jpvt, double rcond, int *rank, double *work, int lwork)
 
int C_DGEQLF (int m, int n, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DGEQP3 (int m, int n, double *a, int lda, int *jpvt, double *tau, double *work, int lwork)
 
int C_DGEQPF (int m, int n, double *a, int lda, int *jpvt, double *tau, double *work)
 
int C_DGEQRF (int m, int n, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DGERFS (char trans, int n, int nrhs, double *a, int lda, double *af, int ldaf, int *ipiv, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DGERQF (int m, int n, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DGESDD (char jobz, int m, int n, double *a, int lda, double *s, double *u, int ldu, double *vt, int ldvt, double *work, int lwork, int *iwork)
 
int C_DGESV (int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb)
 
int C_DGESVX (char fact, char trans, int n, int nrhs, double *a, int lda, double *af, int ldaf, int *ipiv, char equed, double *r, double *c, double *b, int ldb, double *x, int ldx, double *rcond, double *ferr, double *berr, double *work, int *iwork)
 
int C_DGETRF (int m, int n, double *a, int lda, int *ipiv)
 
int C_DGETRI (int n, double *a, int lda, int *ipiv, double *work, int lwork)
 
int C_DGETRS (char trans, int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb)
 
int C_DGGBAK (char job, char side, int n, int ilo, int ihi, double *lscale, double *rscale, int m, double *v, int ldv)
 
int C_DGGBAL (char job, int n, double *a, int lda, double *b, int ldb, int *ilo, int *ihi, double *lscale, double *rscale, double *work)
 
int C_DGGES (char jobvsl, char jobvsr, char sort, int n, double *a, int lda, double *b, int ldb, int *sdim, double *alphar, double *alphai, double *beta, double *vsl, int ldvsl, double *vsr, int ldvsr, double *work, int lwork)
 
int C_DGGESX (char jobvsl, char jobvsr, char sort, char sense, int n, double *a, int lda, double *b, int ldb, int *sdim, double *alphar, double *alphai, double *beta, double *vsl, int ldvsl, double *vsr, int ldvsr, double *rconde, double *rcondv, double *work, int lwork, int *iwork, int liwork)
 
int C_DGGEV (char jobvl, char jobvr, int n, double *a, int lda, double *b, int ldb, double *alphar, double *alphai, double *beta, double *vl, int ldvl, double *vr, int ldvr, double *work, int lwork)
 
int C_DGGEVX (char balanc, char jobvl, char jobvr, char sense, int n, double *a, int lda, double *b, int ldb, double *alphar, double *alphai, double *beta, double *vl, int ldvl, double *vr, int ldvr, int *ilo, int *ihi, double *lscale, double *rscale, double *abnrm, double *bbnrm, double *rconde, double *rcondv, double *work, int lwork, int *iwork)
 
int C_DGGGLM (int n, int m, int p, double *a, int lda, double *b, int ldb, double *d, double *x, double *y, double *work, int lwork)
 
int C_DGGHRD (char compq, char compz, int n, int ilo, int ihi, double *a, int lda, double *b, int ldb, double *q, int ldq, double *z, int ldz)
 
int C_DGGLSE (int m, int n, int p, double *a, int lda, double *b, int ldb, double *c, double *d, double *x, double *work, int lwork)
 
int C_DGGQRF (int n, int m, int p, double *a, int lda, double *taua, double *b, int ldb, double *taub, double *work, int lwork)
 
int C_DGGRQF (int m, int p, int n, double *a, int lda, double *taua, double *b, int ldb, double *taub, double *work, int lwork)
 
int C_DGGSVD (char jobu, char jobv, char jobq, int m, int n, int p, int *k, int *l, double *a, int lda, double *b, int ldb, double *alpha, double *beta, double *u, int ldu, double *v, int ldv, double *q, int ldq, double *work, int *iwork)
 
int C_DGGSVP (char jobu, char jobv, char jobq, int m, int p, int n, double *a, int lda, double *b, int ldb, double tola, double tolb, int *k, int *l, double *u, int ldu, double *v, int ldv, double *q, int ldq, int *iwork, double *tau, double *work)
 
int C_DGTCON (char norm, int n, double *dl, double *d, double *du, double *du2, int *ipiv, double anorm, double *rcond, double *work, int *iwork)
 
int C_DGTRFS (char trans, int n, int nrhs, double *dl, double *d, double *du, double *dlf, double *df, double *duf, double *du2, int *ipiv, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DGTSV (int n, int nrhs, double *dl, double *d, double *du, double *b, int ldb)
 
int C_DGTSVX (char fact, char trans, int n, int nrhs, double *dl, double *d, double *du, double *dlf, double *df, double *duf, double *du2, int *ipiv, double *b, int ldb, double *x, int ldx, double *rcond)
 
int C_DGTTRF (int n, double *dl, double *d, double *du, double *du2, int *ipiv)
 
int C_DGTTRS (char trans, int n, int nrhs, double *dl, double *d, double *du, double *du2, int *ipiv, double *b, int ldb)
 
int C_DHGEQZ (char job, char compq, char compz, int n, int ilo, int ihi, double *h, int ldh, double *t, int ldt, double *alphar, double *alphai, double *beta, double *q, int ldq, double *z, int ldz, double *work, int lwork)
 
int C_DHSEIN (char side, char eigsrc, char initv, int n, double *h, int ldh, double *wr, double *wi, double *vl, int ldvl, double *vr, int ldvr, int mm, int *m, double *work, int *ifaill, int *ifailr)
 
int C_DHSEQR (char job, char compz, int n, int ilo, int ihi, double *h, int ldh, double *wr, double *wi, double *z, int ldz, double *work, int lwork)
 
int C_DOPGTR (char uplo, int n, double *ap, double *tau, double *q, int ldq, double *work)
 
int C_DOPMTR (char side, char uplo, char trans, int m, int n, double *ap, double *tau, double *c, int ldc, double *work)
 
int C_DORGBR (char vect, int m, int n, int k, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DORGHR (int n, int ilo, int ihi, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DORGLQ (int m, int n, int k, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DORGQL (int m, int n, int k, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DORGQR (int m, int n, int k, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DORGRQ (int m, int n, int k, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DORGTR (char uplo, int n, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DORMBR (char vect, char side, char trans, int m, int n, int k, double *a, int lda, double *tau, double *c, int ldc, double *work, int lwork)
 
int C_DORMHR (char side, char trans, int m, int n, int ilo, int ihi, double *a, int lda, double *tau, double *c, int ldc, double *work, int lwork)
 
int C_DORMLQ (char side, char trans, int m, int n, int k, double *a, int lda, double *tau, double *c, int ldc, double *work, int lwork)
 
int C_DORMQL (char side, char trans, int m, int n, int k, double *a, int lda, double *tau, double *c, int ldc, double *work, int lwork)
 
int C_DORMQR (char side, char trans, int m, int n, int k, double *a, int lda, double *tau, double *c, int ldc, double *work, int lwork)
 
int C_DORMR3 (char side, char trans, int m, int n, int k, int l, double *a, int lda, double *tau, double *c, int ldc, double *work)
 
int C_DORMRQ (char side, char trans, int m, int n, int k, double *a, int lda, double *tau, double *c, int ldc, double *work, int lwork)
 
int C_DORMRZ (char side, char trans, int m, int n, int k, int l, double *a, int lda, double *tau, double *c, int ldc, double *work, int lwork)
 
int C_DORMTR (char side, char uplo, char trans, int m, int n, double *a, int lda, double *tau, double *c, int ldc, double *work, int lwork)
 
int C_DPBCON (char uplo, int n, int kd, double *ab, int ldab, double anorm, double *rcond, double *work, int *iwork)
 
int C_DPBEQU (char uplo, int n, int kd, double *ab, int ldab, double *s, double *scond, double *amax)
 
int C_DPBRFS (char uplo, int n, int kd, int nrhs, double *ab, int ldab, double *afb, int ldafb, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DPBSTF (char uplo, int n, int kd, double *ab, int ldab)
 
int C_DPBSV (char uplo, int n, int kd, int nrhs, double *ab, int ldab, double *b, int ldb)
 
int C_DPBSVX (char fact, char uplo, int n, int kd, int nrhs, double *ab, int ldab, double *afb, int ldafb, char equed, double *s, double *b, int ldb, double *x, int ldx, double *rcond, double *ferr, double *berr, double *work, int *iwork)
 
int C_DPBTRF (char uplo, int n, int kd, double *ab, int ldab)
 
int C_DPBTRS (char uplo, int n, int kd, int nrhs, double *ab, int ldab, double *b, int ldb)
 
int C_DPOCON (char uplo, int n, double *a, int lda, double anorm, double *rcond, double *work, int *iwork)
 
int C_DPOEQU (int n, double *a, int lda, double *s, double *scond, double *amax)
 
int C_DPORFS (char uplo, int n, int nrhs, double *a, int lda, double *af, int ldaf, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DPOSV (char uplo, int n, int nrhs, double *a, int lda, double *b, int ldb)
 
int C_DPOSVX (char fact, char uplo, int n, int nrhs, double *a, int lda, double *af, int ldaf, char equed, double *s, double *b, int ldb, double *x, int ldx, double *rcond, double *ferr, double *berr, double *work, int *iwork)
 
int C_DPOTRF (char uplo, int n, double *a, int lda)
 
int C_DPOTRI (char uplo, int n, double *a, int lda)
 
int C_DPOTRS (char uplo, int n, int nrhs, double *a, int lda, double *b, int ldb)
 
int C_DPPCON (char uplo, int n, double *ap, double anorm, double *rcond, double *work, int *iwork)
 
int C_DPPEQU (char uplo, int n, double *ap, double *s, double *scond, double *amax)
 
int C_DPPRFS (char uplo, int n, int nrhs, double *ap, double *afp, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DPPSV (char uplo, int n, int nrhs, double *ap, double *b, int ldb)
 
int C_DPPSVX (char fact, char uplo, int n, int nrhs, double *ap, double *afp, char equed, double *s, double *b, int ldb, double *x, int ldx, double *rcond, double *ferr, double *berr, double *work, int *iwork)
 
int C_DPPTRF (char uplo, int n, double *ap)
 
int C_DPPTRI (char uplo, int n, double *ap)
 
int C_DPPTRS (char uplo, int n, int nrhs, double *ap, double *b, int ldb)
 
int C_DPTCON (int n, double *d, double *e, double anorm, double *rcond, double *work)
 
int C_DPTEQR (char compz, int n, double *d, double *e, double *z, int ldz, double *work)
 
int C_DPTRFS (int n, int nrhs, double *d, double *e, double *df, double *ef, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work)
 
int C_DPTSV (int n, int nrhs, double *d, double *e, double *b, int ldb)
 
int C_DPTSVX (char fact, int n, int nrhs, double *d, double *e, double *df, double *ef, double *b, int ldb, double *x, int ldx, double *rcond, double *ferr, double *berr, double *work)
 
int C_DPTTRF (int n, double *d, double *e)
 
int C_DPTTRS (int n, int nrhs, double *d, double *e, double *b, int ldb)
 
int C_DSBEV (char jobz, char uplo, int n, int kd, double *ab, int ldab, double *w, double *z, int ldz, double *work)
 
int C_DSBEVD (char jobz, char uplo, int n, int kd, double *ab, int ldab, double *w, double *z, int ldz, double *work, int lwork, int *iwork, int liwork)
 
int C_DSBEVX (char jobz, char range, char uplo, int n, int kd, double *ab, int ldab, double *q, int ldq, double vl, double vu, int il, int iu, double abstol, int *m, double *w, double *z, int ldz, double *work, int *iwork, int *ifail)
 
int C_DSBGST (char vect, char uplo, int n, int ka, int kb, double *ab, int ldab, double *bb, int ldbb, double *x, int ldx, double *work)
 
int C_DSBGV (char jobz, char uplo, int n, int ka, int kb, double *ab, int ldab, double *bb, int ldbb, double *w, double *z, int ldz, double *work)
 
int C_DSBGVD (char jobz, char uplo, int n, int ka, int kb, double *ab, int ldab, double *bb, int ldbb, double *w, double *z, int ldz, double *work, int lwork, int *iwork, int liwork)
 
int C_DSBGVX (char jobz, char range, char uplo, int n, int ka, int kb, double *ab, int ldab, double *bb, int ldbb, double *q, int ldq, double vl, double vu, int il, int iu, double abstol, int *m, double *w, double *z, int ldz, double *work, int *iwork, int *ifail)
 
int C_DSBTRD (char vect, char uplo, int n, int kd, double *ab, int ldab, double *d, double *e, double *q, int ldq, double *work)
 
int C_DSGESV (int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb, double *x, int ldx, double *work, int *iter)
 
int C_DSPCON (char uplo, int n, double *ap, int *ipiv, double anorm, double *rcond, double *work, int *iwork)
 
int C_DSPEV (char jobz, char uplo, int n, double *ap, double *w, double *z, int ldz, double *work)
 
int C_DSPEVD (char jobz, char uplo, int n, double *ap, double *w, double *z, int ldz, double *work, int lwork, int *iwork, int liwork)
 
int C_DSPEVX (char jobz, char range, char uplo, int n, double *ap, double vl, double vu, int il, int iu, double abstol, int *m, double *w, double *z, int ldz, double *work, int *iwork, int *ifail)
 
int C_DSPGST (int itype, char uplo, int n, double *ap, double *bp)
 
int C_DSPGV (int itype, char jobz, char uplo, int n, double *ap, double *bp, double *w, double *z, int ldz, double *work)
 
int C_DSPGVD (int itype, char jobz, char uplo, int n, double *ap, double *bp, double *w, double *z, int ldz, double *work, int lwork, int *iwork, int liwork)
 
int C_DSPGVX (int itype, char jobz, char range, char uplo, int n, double *ap, double *bp, double vl, double vu, int il, int iu, double abstol, int *m, double *w, double *z, int ldz, double *work, int *iwork, int *ifail)
 
int C_DSPRFS (char uplo, int n, int nrhs, double *ap, double *afp, int *ipiv, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DSPSV (char uplo, int n, int nrhs, double *ap, int *ipiv, double *b, int ldb)
 
int C_DSPSVX (char fact, char uplo, int n, int nrhs, double *ap, double *afp, int *ipiv, double *b, int ldb, double *x, int ldx, double *rcond)
 
int C_DSPTRD (char uplo, int n, double *ap, double *d, double *e, double *tau)
 
int C_DSPTRF (char uplo, int n, double *ap, int *ipiv)
 
int C_DSPTRI (char uplo, int n, double *ap, int *ipiv, double *work)
 
int C_DSPTRS (char uplo, int n, int nrhs, double *ap, int *ipiv, double *b, int ldb)
 
int C_DSTEBZ (char range, char order, int n, double vl, double vu, int il, int iu, double abstol, double *d, double *e, int *m, int *nsplit, double *w, int *iblock, int *isplit, double *work, int *iwork)
 
int C_DSTEDC (char compz, int n, double *d, double *e, double *z, int ldz, double *work, int lwork, int *iwork, int liwork)
 
int C_DSTEGR (char jobz, char range, int n, double *d, double *e, double vl, double vu, int il, int iu, double abstol, int *m, double *w, double *z, int ldz, int *isuppz, double *work, int lwork, int *iwork, int liwork)
 
int C_DSTEIN (int n, double *d, double *e, int m, double *w, int *iblock, int *isplit, double *z, int ldz, double *work, int *iwork, int *ifail)
 
int C_DSTEQR (char compz, int n, double *d, double *e, double *z, int ldz, double *work)
 
int C_DSTERF (int n, double *d, double *e)
 
int C_DSTEV (char jobz, int n, double *d, double *e, double *z, int ldz, double *work)
 
int C_DSTEVD (char jobz, int n, double *d, double *e, double *z, int ldz, double *work, int lwork, int *iwork, int liwork)
 
int C_DSTEVR (char jobz, char range, int n, double *d, double *e, double vl, double vu, int il, int iu, double abstol, int *m, double *w, double *z, int ldz, int *isuppz, double *work, int lwork, int *iwork, int liwork)
 
int C_DSTEVX (char jobz, char range, int n, double *d, double *e, double vl, double vu, int il, int iu, double abstol, int *m, double *w, double *z, int ldz, double *work, int *iwork, int *ifail)
 
int C_DSYCON (char uplo, int n, double *a, int lda, int *ipiv, double anorm, double *rcond, double *work, int *iwork)
 
int C_DSYEV (char jobz, char uplo, int n, double *a, int lda, double *w, double *work, int lwork)
 
int C_DSYEVD (char jobz, char uplo, int n, double *a, int lda, double *w, double *work, int lwork, int *iwork, int liwork)
 
int C_DSYEVR (char jobz, char range, char uplo, int n, double *a, int lda, double vl, double vu, int il, int iu, double abstol, int *m, double *w, double *z, int ldz, int *isuppz, double *work, int lwork, int *iwork, int liwork)
 
int C_DSYEVX (char jobz, char range, char uplo, int n, double *a, int lda, double vl, double vu, int il, int iu, double abstol, int *m, double *w, double *z, int ldz, double *work, int lwork, int *iwork, int *ifail)
 
int C_DSYGST (int itype, char uplo, int n, double *a, int lda, double *b, int ldb)
 
int C_DSYGV (int itype, char jobz, char uplo, int n, double *a, int lda, double *b, int ldb, double *w, double *work, int lwork)
 
int C_DSYGVD (int itype, char jobz, char uplo, int n, double *a, int lda, double *b, int ldb, double *w, double *work, int lwork, int *iwork, int liwork)
 
int C_DSYGVX (int itype, char jobz, char range, char uplo, int n, double *a, int lda, double *b, int ldb, double vl, double vu, int il, int iu, double abstol, int *m, double *w, double *z, int ldz, double *work, int lwork, int *iwork, int *ifail)
 
int C_DSYRFS (char uplo, int n, int nrhs, double *a, int lda, double *af, int ldaf, int *ipiv, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DSYSV (char uplo, int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb, double *work, int lwork)
 
int C_DSYSVX (char fact, char uplo, int n, int nrhs, double *a, int lda, double *af, int ldaf, int *ipiv, double *b, int ldb, double *x, int ldx, double *rcond)
 
int C_DSYTRD (char uplo, int n, double *a, int lda, double *d, double *e, double *tau, double *work, int lwork)
 
int C_DSYTRF (char uplo, int n, double *a, int lda, int *ipiv, double *work, int lwork)
 
int C_DSYTRI (char uplo, int n, double *a, int lda, int *ipiv, double *work)
 
int C_DSYTRS (char uplo, int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb)
 
int C_DTBCON (char norm, char uplo, char diag, int n, int kd, double *ab, int ldab, double *rcond, double *work, int *iwork)
 
int C_DTBRFS (char uplo, char trans, char diag, int n, int kd, int nrhs, double *ab, int ldab, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DTBTRS (char uplo, char trans, char diag, int n, int kd, int nrhs, double *ab, int ldab, double *b, int ldb)
 
int C_DTGEVC (char side, char howmny, int n, double *s, int lds, double *p, int ldp, double *vl, int ldvl, double *vr, int ldvr, int mm, int *m, double *work)
 
int C_DTGEXC (int n, double *a, int lda, double *b, int ldb, double *q, int ldq, double *z, int ldz, int *ifst, int *ilst, double *work, int lwork)
 
int C_DTGSEN (int ijob, int n, double *a, int lda, double *b, int ldb, double *alphar, double *alphai, double *beta, double *q, int ldq, double *z, int ldz, int *m, double *pl, double *pr, double *dif, double *work, int lwork, int *iwork, int liwork)
 
int C_DTGSJA (char jobu, char jobv, char jobq, int m, int p, int n, int k, int l, double *a, int lda, double *b, int ldb, double tola, double tolb, double *alpha, double *beta, double *u, int ldu, double *v, int ldv, double *q, int ldq, double *work, int *ncycle)
 
int C_DTGSNA (char job, char howmny, int n, double *a, int lda, double *b, int ldb, double *vl, int ldvl, double *vr, int ldvr, double *s, double *dif, int mm, int *m, double *work, int lwork, int *iwork)
 
int C_DTGSYL (char trans, int ijob, int m, int n, double *a, int lda, double *b, int ldb, double *c, int ldc, double *d, int ldd, double *e, int lde, double *f, int ldf, double *dif, double *scale, double *work, int lwork, int *iwork)
 
int C_DTPCON (char norm, char uplo, char diag, int n, double *ap, double *rcond, double *work, int *iwork)
 
int C_DTPRFS (char uplo, char trans, char diag, int n, int nrhs, double *ap, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DTPTRI (char uplo, char diag, int n, double *ap)
 
int C_DTPTRS (char uplo, char trans, char diag, int n, int nrhs, double *ap, double *b, int ldb)
 
int C_DTRCON (char norm, char uplo, char diag, int n, double *a, int lda, double *rcond, double *work, int *iwork)
 
int C_DTREVC (char side, char howmny, int n, double *t, int ldt, double *vl, int ldvl, double *vr, int ldvr, int mm, int *m, double *work)
 
int C_DTREXC (char compq, int n, double *t, int ldt, double *q, int ldq, int *ifst, int *ilst, double *work)
 
int C_DTRRFS (char uplo, char trans, char diag, int n, int nrhs, double *a, int lda, double *b, int ldb, double *x, int ldx, double *ferr, double *berr, double *work, int *iwork)
 
int C_DTRSEN (char job, char compq, int n, double *t, int ldt, double *q, int ldq, double *wr, double *wi, int *m, double *s, double *sep, double *work, int lwork, int *iwork, int liwork)
 
int C_DTRSNA (char job, char howmny, int n, double *t, int ldt, double *vl, int ldvl, double *vr, int ldvr, double *s, double *sep, int mm, int *m, double *work, int ldwork, int *iwork)
 
int C_DTRSYL (char trana, char tranb, int isgn, int m, int n, double *a, int lda, double *b, int ldb, double *c, int ldc, double *scale)
 
int C_DTRTRI (char uplo, char diag, int n, double *a, int lda)
 
int C_DTRTRS (char uplo, char trans, char diag, int n, int nrhs, double *a, int lda, double *b, int ldb)
 
int C_DTZRQF (int m, int n, double *a, int lda, double *tau)
 
int C_DTZRZF (int m, int n, double *a, int lda, double *tau, double *work, int lwork)
 
int C_DGEEV (int n, double **a, int lda, double *wr, double *wi, double **vl, int ldvl, double **vr, int ldvr, double *work, int lwork, int info)
 
int C_DGESVD (char jobu, char jobvt, int m, int n, double *A, int lda, double *s, double *u, int ldu, double *vt, int ldvt, double *work, int lwork)
 
int mat_print (double **matrix, int rows, int cols, std::string out)
 
void newmm_rking (double **A, int transa, double **B, int transb, double **C, int num_rows, int num_links, int num_cols, double alpha, double beta)
 
void normalize (double **A, int rows, int cols)
 
int pople (double **A, double *x, int dimen, int, double tolerance, std::string out, int print_lvl)
 
double combinations (int n, int k)
 
double factorial (int n)
 
void schmidt (double **A, int rows, int cols, std::string out_fname)
 
int schmidt_add (double **A, int rows, int cols, double *v)
 
void solve_2x2_pep (double **H, double S, double *evals, double **evecs)
 
void reorder_qt (int *docc_in, int *socc_in, int *frozen_docc_in, int *frozen_uocc_in, int *order, int *orbs_per_irrep, int nirreps)
 
void reorder_qt_uhf (int *docc, int *socc, int *frozen_docc, int *frozen_uocc, int *order_alpha, int *order_beta, int *orbspi, int nirreps)
 
int ras_set3 (int nirreps, int nmo, int *orbspi, int *docc, int *socc, int *frdocc, int *fruocc, int *restrdocc, int *restruocc, int **ras_opi, int *core_guess, int *order, int ras_type, bool is_mcscf, Options &options)
 
void timer_init (void)
 
void timer_done (void)
 
void timer_on (const std::string &key)
 
void timer_off (const std::string &key)
 
void parallel_timer_on (const std::string &key, int thread_rank)
 
void parallel_timer_off (const std::string &key, int thread_rank)
 
void start_skip_timers ()
 
void stop_skip_timers ()
 
void print_block (double *, int, int, FILE *)
 
int * get_frzcpi ()
 
int * get_frzvpi ()
 
void stringset_init (StringSet *stringset, int size, int nelec, int ndrc, short int *frozen_occ)
 
void stringset_delete (StringSet *stringset)
 
void stringset_add (StringSet *stringset, int index, unsigned char *Occ)
 
void stringset_write (size_t unit, const char *prefix, StringSet *sset)
 
void stringset_read (size_t unit, const char *prefix, StringSet **sset)
 
void stringset_reindex (StringSet *stringset, short int *mo_map)
 
void slaterdetset_init (SlaterDetSet *sdset, int size, StringSet *alphastrings, StringSet *betastrings)
 
void slaterdetset_delete (SlaterDetSet *sdset)
 
void slaterdetset_delete_full (SlaterDetSet *sdset)
 
void slaterdetset_add (SlaterDetSet *sdset, int index, int alphastring, int betastring)
 
void slaterdetset_write (size_t unit, const char *prefix, SlaterDetSet *sdset)
 
void slaterdetset_read (size_t unit, const char *prefix, SlaterDetSet **sdset)
 
void slaterdetvector_init (SlaterDetVector *sdvector, SlaterDetSet *sdset)
 
void slaterdetvector_delete (SlaterDetVector *sdvector)
 
void slaterdetvector_delete_full (SlaterDetVector *sdvector)
 
void slaterdetvector_set (SlaterDetVector *sdvector, double *coeffs)
 
void slaterdetvector_write (size_t unit, const char *prefix, SlaterDetVector *vector)
 
void slaterdetset_write_vect (size_t unit, const char *prefix, double *coeffs, int size, int vectnum)
 
void slaterdetvector_read (size_t unit, const char *prefix, SlaterDetVector **vector)
 
void slaterdetset_read_vect (size_t unit, const char *prefix, double *coeffs, int size, int vectnum)
 
void print_timer (const Timer_Structure &timer, std::shared_ptr< PsiOutStream > printer, int align_key_width)
 
void print_nested_timer (const Timer_Structure &timer, std::shared_ptr< PsiOutStream > printer, const std::string &indent)
 
bool empty_parallel ()
 
template<class DPDFunctor , class FockFunctor >
void iwl_integrals (IWL *iwl, DPDFunctor &dpd, FockFunctor &fock)
 
void psiclean (void)
 
int ** compute_atom_map (const Molecule *molecule, double tol, bool suppress_mol_print_in_exc)
 
int ** compute_atom_map (const std::shared_ptr< Molecule > &molecule, double tol, bool suppress_mol_print_in_exc)
 
void delete_atom_map (int **atom_map, const Molecule *molecule)
 
void delete_atom_map (int **atom_map, const std::shared_ptr< Molecule > &molecule)
 

Variables

char * psi_file_prefix
 
std::string outfile_name
 
std::string restart_id
 
std::shared_ptr< PsiOutStreamoutfile
 
time_t time_start
 
time_t time_end
 
time_t time_start_overall
 
int running = 0
 
double user_start
 
double sys_start
 
double user_start_overall
 
double sys_start_overall
 
double user_stop
 
double sys_stop
 
const double RvdW_D1_ []
 
const double C6_D1_ []
 
const double RvdW_D2_ []
 
const double C6_D2_ []
 
const double R_cov_ []
 
const double C6_Das2009_ []
 
const double C8_Das2009_ []
 
const double Beta_Das2009_ []
 
const double A_Das2009_ []
 
const double C6_Das2010_ []
 
const double C8_Das2010_ []
 
const double Beta_Das2010_ []
 
double R_0_AB_ []
 
dpd_gbl dpd_main
 
DPDglobal_dpd_ = NULL
 
int dpd_default = 0
 
DPDdpd_list [2] = {NULL, NULL}
 
const double SMALL = 1.0E-7
 
const int TAYLOR_CUT = 5
 
size_t counter
 
std::smatch reMatches_
 
const std::string RotorTypeList []
 
const std::string FullPointGroupList []
 
const char * labels []
 
ModelSpacemodel_space
 
MOInfoSCFmoinfo_scf = 0
 
const std::string empty_
 
psio_address PSIO_ZERO = { 0, 0 }
 
std::shared_ptr< PSIO_default_psio_lib_
 
std::shared_ptr< PSIOManager_default_psio_manager_
 
int nmo
 
int nso
 
int nao
 
double ** scf
 
double ** u
 
std::shared_ptr< Moleculemolecule
 
std::shared_ptr< BasisSetbasis
 
std::shared_ptr< Wavefunctionwfn
 
Timer_Structure root_timer (nullptr,"")
 
Timer_Structure parallel_timer (nullptr,"")
 
std::list< Timer_Structure * > ser_on_timers
 
std::vector< std::list
< Timer_Structure * > > 
par_on_timers
 
time_t timer_start
 
time_t timer_end
 
bool skip_timers
 
static omp_lock_t lock_timer
 

Detailed Description

This is all defined in python.cc initialize.

AEL() computes the approximate excitation level according to Stanton and Bartlett, JCP, 98, 1993, 7034. Trace [rho(excited) - rho(ground)] = AEL where both densities are expressed in the basis that diagonalizes the ground-state CCSD density. I was never able to get these results to agree with those of JFS or the current ACES2 so I'm not going to use this right now. –RAK

Standard library includes

Standard library includes Required PSI3 includes Required libmints includes

! This is a generalized second-order SCF module capable of computing the optimal orbital rotations at each macroiteration for RHF, RASSCF, and CASSCF.

Derived from the purple book Chapters 10.8.8,

Indices: mu, nu, sigma, ro - General AO indices mnopqrs - General MO indices ijkl - Occupied indices tuvw - Active indices abcd - Virtual indices

psimath.h A set of wrappers to BLAS and LAPACK for use with Matrix, Vector, and IntVector Rob Parrish 1/25/2010

Typedef Documentation

using psi::clock = typedef std::chrono::high_resolution_clock
typedef short int psi::Label
typedef SharedWavefunction(* psi::plugin_t)(SharedWavefunction, Options &)
typedef int(* psi::read_options_t)(std::string, Options &)
typedef std::shared_ptr<GridBlock> psi::SharedGridBlock
using psi::SharedIntVector = typedef std::shared_ptr<IntVector>
typedef std::shared_ptr< Matrix > psi::SharedMatrix
using psi::SharedMolecule = typedef std::shared_ptr<Molecule>
typedef std::shared_ptr<OneBodyAOInt> psi::SharedOneBodyAOInt
typedef std::shared_ptr<OneBodySOInt> psi::SharedOneBodySOInt
typedef std::shared_ptr<TwoBodyAOInt> psi::SharedTwoBodyAOInt
typedef std::shared_ptr<TwoBodySOInt> psi::SharedTwoBodySOInt
typedef std::shared_ptr< Vector > psi::SharedVector
using psi::SharedWavefunction = typedef std::shared_ptr<Wavefunction>
typedef std::vector<std::pair<int, int> > psi::ShellPairBlock

SlaterDetSet is a set of Slater determinants

typedef std::vector<std::shared_ptr< MOSpace> > psi::SpaceVec
typedef std::vector<std::string> psi::strvec
typedef double psi::Value

Enumeration Type Documentation

Enumerator
XAxis 
YAxis 
ZAxis 
Enumerator
evals_only_ascending 
ascending 
evals_only_descending 
descending 
Enumerator
PG_ATOM 
PG_Cinfv 
PG_Dinfh 
PG_C1 
PG_Cs 
PG_Ci 
PG_Cn 
PG_Cnv 
PG_Cnh 
PG_Sn 
PG_Dn 
PG_Dnd 
PG_Dnh 
PG_Td 
PG_Oh 
PG_Ih 
Enumerator
Cartesian 
Pure 
Enumerator
ONEPOINT 
TWOPOINT 
Enumerator
pqrs 
pqsr 
prqs 
prsq 
psqr 
psrq 
qprs 
qpsr 
qrps 
qrsp 
qspr 
qsrp 
rqps 
rqsp 
rpqs 
rpsq 
rsqp 
rspq 
sqrp 
sqpr 
srqp 
srpq 
spqr 
sprq 
Enumerator
abc 
acb 
cab 
cba 
bca 
bac 
Enumerator
ABCD 
BACD 
ABDC 
BADC 
CDAB 
CDBA 
DCAB 
DCBA 
Enumerator
Normalized 
Unnormalized 
Enumerator
Success 
Failure 
Balk 
EndLoop 
Enumerator
AllRefs 
UniqueRefs 
ClosedShellRefs 
UniqueOpenShellRefs 
Enumerator
RT_ASYMMETRIC_TOP 
RT_SYMMETRIC_TOP 
RT_SPHERICAL_TOP 
RT_LINEAR 
RT_ATOM 
Enumerator
Gaussian 
ECPType1 
ECPType2 
Enumerator
OFF 
ON 
PARALLEL 

Function Documentation

std::string psi::add_reference ( std::string &  str,
int  reference 
)
void psi::append_reference ( std::string &  str,
int  reference 
)
void psi::arr_to_mat ( double **  a,
double *  b,
int  m,
int  n 
)
bool psi::atom_present_in_geom ( Matrix &  geom,
Vector3 &  b,
double  tol 
)
std::regex psi::atomSymbol_ ( "(([A-Z]{1,3})(?:(_\\w+)|(\\d+))?(?:@(\\d+\\.\\d+))?)"  ,
std::regex_constants::icase   
)
void psi::balance ( double **  a,
int  n 
)
void psi::benchmark_blas1 ( int  N,
double  min_time 
)

Perform a benchmark traverse of BLAS 1 routines on the current hardware

Parameters
Nmaximum dimension exponent (requires ~ 3 (2^N x 2^N) double matrices
min_timeminimum amount of time to run each routine [s]
nthreadmaximum number of threads to use
void psi::benchmark_blas2 ( int  N,
double  min_time 
)

Perform a benchmark traverse of BLAS 2 routines on the current hardware

Parameters
Nmaximum dimension exponent (requires ~ 3 (2^N x 2^N) double matrices
min_timeminimum amount of time to run each routine [s]
nthreadmaximum number of threads to use
void psi::benchmark_blas3 ( int  N,
double  min_time,
int  nthread = 1 
)

Perform a benchmark traverse of BLAS 3 and LAPACK routines on the current hardware

Parameters
Nmaximum dimension exponent (requires ~ 4 (2^N x 2^N) double matrices
min_timeminimum amount of time to run each routine [s]
nthreadmaximum number of threads to use
void psi::benchmark_disk ( int  N,
double  min_time 
)

Perform a benchmark of PSIO disk performance on the current hardware

Parameters
Nmaximum dimension exponent (requires 1 (2^N x 2^N) double matrices
min_timeminimum amount of time to run each routine [s]
void psi::benchmark_integrals ( int  max_am,
double  min_time 
)

Perform a benchmark of psi integrals (of libmints type) on the current hardware All integrals will be called from different centers

Parameters
max_ammaximum am to consider
min_timeminimum time to run each shell combination of each integral type

Poisson Ints this_type = "2C Poisson"; this_ncenter = 2; std::shared_ptr<OneBodyAOInt> p2c(bbbb->poisson_overlap()); for (int P = 0, index = 0; P < max_shell; P++) { for (int Q = 0; Q < max_shell; Q++, index++) { T = 0.0; rounds = 0L; qq = new Timer(); while (T < min_time) { p2c->compute_shell(P, Q + max_shell); T = qq->get(); rounds++; } delete qq; t = T / (double) (rounds * n_per_combination[this_ncenter][index]); timings[this_type][index] = t; } }

void psi::benchmark_math ( double  min_time)

Perform a benchmark of common double floating point operations, including most of cmath

Parameters
min_timeminimum amount of time to run each routine [s]
std::regex psi::blankLine_ ( "*"  [\\s%],
std::regex_constants::icase   
)
double ** psi::block_matrix ( size_t  n,
size_t  m,
bool  memlock 
)

block_matrix(): Allocate a 2D array of doubles using contiguous memory

Allocates a contiguous block of memory for an array of doubles, allocates an array of pointers to the beginning of each row and returns the pointer to the first row pointer. This allows transparent 2d-array style access, but keeps memory together such that the matrix could be used in conjunction with FORTRAN matrix routines.

Allocates memory for an n x m matrix and returns a pointer to the first row.

Parameters
n= number of rows (size_t to allow large matrices)
m= number of columns (size_t to allow large matrices)
memlock= optional bool indicating whether to lock memory into physical RAM or not, and available only where _POSIX_MEMLOCK is defined. Defaults to false if not specified.

Returns: double star pointer to newly allocated matrix

T. Daniel Crawford Sometime in 1994

Based on init_matrix() from libciomr

void psi::block_to_tri ( double *  a,
double **  b,
int  num_ir,
int *  num_so,
int *  ioff 
)
double psi::bytes_to_MiB ( size_t  n)
int psi::C_DBDSDC ( char  uplo,
char  compq,
int  n,
double *  d,
double *  e,
double *  u,
int  ldu,
double *  vt,
int  ldvt,
double *  q,
int *  iq,
double *  work,
int *  iwork 
)

Purpose

DBDSDC computes the singular value decomposition (SVD) of a real N-by-N (upper or lower) bidiagonal matrix B: B = U * S * VT, using a divide and conquer method, where S is a diagonal matrix with non-negative diagonal elements (the singular values of B), and U and VT are orthogonal matrices of left and right singular vectors, respectively. DBDSDC can be used to compute all singular values, and optionally, singular vectors or singular vectors in compact form.

This code makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none. See DLASD3 for details.

The code currently calls DLASDQ if singular values only are desired. However, it can be slightly modified to compute singular values using the divide and conquer method.

Arguments

UPLO (input) CHARACTER*1 = 'U': B is upper bidiagonal. = 'L': B is lower bidiagonal.

COMPQ (input) CHARACTER*1 Specifies whether singular vectors are to be computed as follows: = 'N': Compute singular values only; = 'P': Compute singular values and compute singular vectors in compact form; = 'I': Compute singular values and singular vectors.

N (input) INTEGER The order of the matrix B. N >= 0.

D (input/output) DOUBLE PRECISION array, dimension (N) On entry, the n diagonal elements of the bidiagonal matrix B. On exit, if INFO=0, the singular values of B.

E (input/output) DOUBLE PRECISION array, dimension (N-1) On entry, the elements of E contain the offdiagonal elements of the bidiagonal matrix whose SVD is desired. On exit, E has been destroyed.

U (output) DOUBLE PRECISION array, dimension (LDU,N) If COMPQ = 'I', then: On exit, if INFO = 0, U contains the left singular vectors of the bidiagonal matrix. For other values of COMPQ, U is not referenced.

LDU (input) INTEGER The leading dimension of the array U. LDU >= 1. If singular vectors are desired, then LDU >= max( 1, N ).

VT (output) DOUBLE PRECISION array, dimension (LDVT,N) If COMPQ = 'I', then: On exit, if INFO = 0, VT' contains the right singular vectors of the bidiagonal matrix. For other values of COMPQ, VT is not referenced.

LDVT (input) INTEGER The leading dimension of the array VT. LDVT >= 1. If singular vectors are desired, then LDVT >= max( 1, N ).

Q (output) DOUBLE PRECISION array, dimension (LDQ) If COMPQ = 'P', then: On exit, if INFO = 0, Q and IQ contain the left and right singular vectors in a compact form, requiring O(N log N) space instead of 2*N**2. In particular, Q contains all the DOUBLE PRECISION data in LDQ >= N*(11 + 2*SMLSIZ + 8*INT(LOG_2(N/(SMLSIZ+1)))) words of memory, where SMLSIZ is returned by ILAENV and is equal to the maximum size of the subproblems at the bottom of the computation tree (usually about 25). For other values of COMPQ, Q is not referenced.

IQ (output) INTEGER array, dimension (LDIQ) If COMPQ = 'P', then: On exit, if INFO = 0, Q and IQ contain the left and right singular vectors in a compact form, requiring O(N log N) space instead of 2*N**2. In particular, IQ contains all INTEGER data in LDIQ >= N*(3 + 3*INT(LOG_2(N/(SMLSIZ+1)))) words of memory, where SMLSIZ is returned by ILAENV and is equal to the maximum size of the subproblems at the bottom of the computation tree (usually about 25). For other values of COMPQ, IQ is not referenced.

WORK (workspace) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) If COMPQ = 'N' then LWORK >= (4 * N). If COMPQ = 'P' then LWORK >= (6 * N). If COMPQ = 'I' then LWORK >= (3 * N**2 + 4 * N).

IWORK (workspace) INTEGER array, dimension (8*N)

C++ Return value: INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value. > 0: The algorithm failed to compute a singular value. The update process of divide and conquer failed.

Further Details

Based on contributions by Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA


Changed dimension statement in comment describing E from (N) to

(N-1). Sven, 17 Feb 05.

.. Parameters ..

int psi::C_DBDSQR ( char  uplo,
int  n,
int  ncvt,
int  nru,
int  ncc,
double *  d,
double *  e,
double *  vt,
int  ldvt,
double *  u,
int  ldu,
double *  c,
int  ldc,
double *  work 
)

Purpose

DBDSQR computes the singular values and, optionally, the right and/or left singular vectors from the singular value decomposition (SVD) of a real N-by-N (upper or lower) bidiagonal matrix B using the implicit zero-shift QR algorithm. The SVD of B has the form

B = Q * S * P**T

where S is the diagonal matrix of singular values, Q is an orthogonal matrix of left singular vectors, and P is an orthogonal matrix of right singular vectors. If left singular vectors are requested, this subroutine actually returns U*Q instead of Q, and, if right singular vectors are requested, this subroutine returns P**T*VT instead of P**T, for given real input matrices U and VT. When U and VT are the orthogonal matrices that reduce a general matrix A to bidiagonal form: A = U*B*VT, as computed by DGEBRD, then

A = (U*Q) * S * (P**T*VT)

is the SVD of A. Optionally, the subroutine may also compute Q**T*C for a given real input matrix C.

See "Computing Small Singular Values of Bidiagonal Matrices With Guaranteed High Relative Accuracy," by J. Demmel and W. Kahan, LAPACK Working Note #3 (or SIAM J. Sci. Statist. Comput. vol. 11, no. 5, pp. 873-912, Sept 1990) and "Accurate singular values and differential qd algorithms," by B. Parlett and V. Fernando, Technical Report CPAM-554, Mathematics Department, University of California at Berkeley, July 1992 for a detailed description of the algorithm.

Arguments

UPLO (input) CHARACTER*1 = 'U': B is upper bidiagonal; = 'L': B is lower bidiagonal.

N (input) INTEGER The order of the matrix B. N >= 0.

NCVT (input) INTEGER The number of columns of the matrix VT. NCVT >= 0.

NRU (input) INTEGER The number of rows of the matrix U. NRU >= 0.

NCC (input) INTEGER The number of columns of the matrix C. NCC >= 0.

D (input/output) DOUBLE PRECISION array, dimension (N) On entry, the n diagonal elements of the bidiagonal matrix B. On exit, if INFO=0, the singular values of B in decreasing order.

E (input/output) DOUBLE PRECISION array, dimension (N-1) On entry, the N-1 offdiagonal elements of the bidiagonal matrix B. On exit, if INFO = 0, E is destroyed; if INFO > 0, D and E will contain the diagonal and superdiagonal elements of a bidiagonal matrix orthogonally equivalent to the one given as input.

VT (input/output) DOUBLE PRECISION array, dimension (LDVT, NCVT) On entry, an N-by-NCVT matrix VT. On exit, VT is overwritten by P**T * VT. Not referenced if NCVT = 0.

LDVT (input) INTEGER The leading dimension of the array VT. LDVT >= max(1,N) if NCVT > 0; LDVT >= 1 if NCVT = 0.

U (input/output) DOUBLE PRECISION array, dimension (LDU, N) On entry, an NRU-by-N matrix U. On exit, U is overwritten by U * Q. Not referenced if NRU = 0.

LDU (input) INTEGER The leading dimension of the array U. LDU >= max(1,NRU).

C (input/output) DOUBLE PRECISION array, dimension (LDC, NCC) On entry, an N-by-NCC matrix C. On exit, C is overwritten by Q**T * C. Not referenced if NCC = 0.

LDC (input) INTEGER The leading dimension of the array C. LDC >= max(1,N) if NCC > 0; LDC >=1 if NCC = 0.

WORK (workspace) DOUBLE PRECISION array, dimension (4*N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: If INFO = -i, the i-th argument had an illegal value > 0: if NCVT = NRU = NCC = 0, = 1, a split was marked by a positive value in E = 2, current block of Z not diagonalized after 30*N iterations (in inner while loop) = 3, termination criterion of outer while loop not met (program created more than N unreduced blocks) else NCVT = NRU = NCC = 0, the algorithm did not converge; D and E contain the elements of a bidiagonal matrix which is orthogonally similar to the input matrix B; if INFO = i, i elements of E have not converged to zero.

Internal Parameters

TOLMUL DOUBLE PRECISION, default = max(10,min(100,EPS**(-1/8))) TOLMUL controls the convergence criterion of the QR loop. If it is positive, TOLMUL*EPS is the desired relative precision in the computed singular values. If it is negative, abs(TOLMUL*EPS*sigma_max) is the desired absolute accuracy in the computed singular values (corresponds to relative accuracy abs(TOLMUL*EPS) in the largest singular value. abs(TOLMUL) should be between 1 and 1/EPS, and preferably between 10 (for fast convergence) and .1/EPS (for there to be some accuracy in the results). Default is to lose at either one eighth or 2 of the available decimal digits in each computed singular value (whichever is smaller).

MAXITR INTEGER, default = 6 MAXITR controls the maximum number of passes of the algorithm through its inner loop. The algorithms stops (and so fails to converge) if the number of passes through the inner loop exceeds MAXITR*N**2.


.. Parameters ..

int psi::C_DDISNA ( char  job,
int  m,
int  n,
double *  d,
double *  sep 
)

Purpose

DDISNA computes the reciprocal condition numbers for the eigenvectors of a real symmetric or complex Hermitian matrix or for the left or right singular vectors of a general m-by-n matrix. The reciprocal condition number is the 'gap' between the corresponding eigenvalue or singular value and the nearest other one.

The bound on the error, measured by angle in radians, in the I-th computed vector is given by

   DLAMCH( 'E' ) * ( ANORM / SEP( I ) )

where ANORM = 2-norm(A) = max( abs( D(j) ) ). SEP(I) is not allowed to be smaller than DLAMCH( 'E' )*ANORM in order to limit the size of the error bound.

DDISNA may also be used to compute error bounds for eigenvectors of the generalized symmetric definite eigenproblem.

Arguments

JOB (input) CHARACTER*1 Specifies for which problem the reciprocal condition numbers should be computed: = 'E': the eigenvectors of a symmetric/Hermitian matrix; = 'L': the left singular vectors of a general matrix; = 'R': the right singular vectors of a general matrix.

M (input) INTEGER The number of rows of the matrix. M >= 0.

N (input) INTEGER If JOB = 'L' or 'R', the number of columns of the matrix, in which case N >= 0. Ignored if JOB = 'E'.

D (input) DOUBLE PRECISION array, dimension (M) if JOB = 'E' dimension (min(M,N)) if JOB = 'L' or 'R' The eigenvalues (if JOB = 'E') or singular values (if JOB = 'L' or 'R') of the matrix, in either increasing or decreasing order. If singular values, they must be non-negative.

SEP (output) DOUBLE PRECISION array, dimension (M) if JOB = 'E' dimension (min(M,N)) if JOB = 'L' or 'R' The reciprocal condition numbers of the vectors.

C++ Return value: INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value.


.. Parameters ..

int psi::C_DGBBRD ( char  vect,
int  m,
int  n,
int  ncc,
int  kl,
int  ku,
double *  ab,
int  ldab,
double *  d,
double *  e,
double *  q,
int  ldq,
double *  pt,
int  ldpt,
double *  c,
int  ldc,
double *  work 
)

Purpose

DGBBRD reduces a real general m-by-n band matrix A to upper bidiagonal form B by an orthogonal transformation: Q' * A * P = B.

The routine computes B, and optionally forms Q or P', or computes Q'*C for a given matrix C.

Arguments

VECT (input) CHARACTER*1 Specifies whether or not the matrices Q and P' are to be formed. = 'N': do not form Q or P'; = 'Q': form Q only; = 'P': form P' only; = 'B': form both.

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

NCC (input) INTEGER The number of columns of the matrix C. NCC >= 0.

KL (input) INTEGER The number of subdiagonals of the matrix A. KL >= 0.

KU (input) INTEGER The number of superdiagonals of the matrix A. KU >= 0.

AB (input/output) DOUBLE PRECISION array, dimension (LDAB,N) On entry, the m-by-n band matrix A, stored in rows 1 to KL+KU+1. The j-th column of A is stored in the j-th column of the array AB as follows: AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl). On exit, A is overwritten by values generated during the reduction.

LDAB (input) INTEGER The leading dimension of the array A. LDAB >= KL+KU+1.

D (output) DOUBLE PRECISION array, dimension (min(M,N)) The diagonal elements of the bidiagonal matrix B.

E (output) DOUBLE PRECISION array, dimension (min(M,N)-1) The superdiagonal elements of the bidiagonal matrix B.

Q (output) DOUBLE PRECISION array, dimension (LDQ,M) If VECT = 'Q' or 'B', the m-by-m orthogonal matrix Q. If VECT = 'N' or 'P', the array Q is not referenced.

LDQ (input) INTEGER The leading dimension of the array Q. LDQ >= max(1,M) if VECT = 'Q' or 'B'; LDQ >= 1 otherwise.

PT (output) DOUBLE PRECISION array, dimension (LDPT,N) If VECT = 'P' or 'B', the n-by-n orthogonal matrix P'. If VECT = 'N' or 'Q', the array PT is not referenced.

LDPT (input) INTEGER The leading dimension of the array PT. LDPT >= max(1,N) if VECT = 'P' or 'B'; LDPT >= 1 otherwise.

C (input/output) DOUBLE PRECISION array, dimension (LDC,NCC) On entry, an m-by-ncc matrix C. On exit, C is overwritten by Q'*C. C is not referenced if NCC = 0.

LDC (input) INTEGER The leading dimension of the array C. LDC >= max(1,M) if NCC > 0; LDC >= 1 if NCC = 0.

WORK (workspace) DOUBLE PRECISION array, dimension (2*max(M,N))

C++ Return value: INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value.


.. Parameters ..

int psi::C_DGBCON ( char  norm,
int  n,
int  kl,
int  ku,
double *  ab,
int  ldab,
int *  ipiv,
double  anorm,
double *  rcond,
double *  work,
int *  iwork 
)

Purpose

DGBCON estimates the reciprocal of the condition number of a real general band matrix A, in either the 1-norm or the infinity-norm, using the LU factorization computed by DGBTRF.

An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as RCOND = 1 / ( norm(A) * norm(inv(A)) ).

Arguments

NORM (input) CHARACTER*1 Specifies whether the 1-norm condition number or the infinity-norm condition number is required: = '1' or 'O': 1-norm; = 'I': Infinity-norm.

N (input) INTEGER The order of the matrix A. N >= 0.

KL (input) INTEGER The number of subdiagonals within the band of A. KL >= 0.

KU (input) INTEGER The number of superdiagonals within the band of A. KU >= 0.

AB (input) DOUBLE PRECISION array, dimension (LDAB,N) Details of the LU factorization of the band matrix A, as computed by DGBTRF. U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1.

LDAB (input) INTEGER The leading dimension of the array AB. LDAB >= 2*KL+KU+1.

IPIV (input) INTEGER array, dimension (N) The pivot indices; for 1 <= i <= N, row i of the matrix was interchanged with row IPIV(i).

ANORM (input) DOUBLE PRECISION If NORM = '1' or 'O', the 1-norm of the original matrix A. If NORM = 'I', the infinity-norm of the original matrix A.

RCOND (output) DOUBLE PRECISION The reciprocal of the condition number of the matrix A, computed as RCOND = 1/(norm(A) * norm(inv(A))).

WORK (workspace) DOUBLE PRECISION array, dimension (3*N)

IWORK (workspace) INTEGER array, dimension (N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value


.. Parameters ..

int psi::C_DGBEQU ( int  m,
int  n,
int  kl,
int  ku,
double *  ab,
int  ldab,
double *  r,
double *  c,
double *  rowcnd,
double *  colcnd,
double *  amax 
)

Purpose

DGBEQU computes row and column scalings intended to equilibrate an M-by-N band matrix A and reduce its condition number. R returns the row scale factors and C the column scale factors, chosen to try to make the largest element in each row and column of the matrix B with elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

R(i) and C(j) are restricted to be between SMLNUM = smallest safe number and BIGNUM = largest safe number. Use of these scaling factors is not guaranteed to reduce the condition number of A but works well in practice.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

KL (input) INTEGER The number of subdiagonals within the band of A. KL >= 0.

KU (input) INTEGER The number of superdiagonals within the band of A. KU >= 0.

AB (input) DOUBLE PRECISION array, dimension (LDAB,N) The band matrix A, stored in rows 1 to KL+KU+1. The j-th column of A is stored in the j-th column of the array AB as follows: AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl).

LDAB (input) INTEGER The leading dimension of the array AB. LDAB >= KL+KU+1.

R (output) DOUBLE PRECISION array, dimension (M) If INFO = 0, or INFO > M, R contains the row scale factors for A.

C (output) DOUBLE PRECISION array, dimension (N) If INFO = 0, C contains the column scale factors for A.

ROWCND (output) DOUBLE PRECISION If INFO = 0 or INFO > M, ROWCND contains the ratio of the smallest R(i) to the largest R(i). If ROWCND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by R.

COLCND (output) DOUBLE PRECISION If INFO = 0, COLCND contains the ratio of the smallest C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.

AMAX (output) DOUBLE PRECISION Absolute value of largest matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, and i is <= M: the i-th row of A is exactly zero > M: the (i-M)-th column of A is exactly zero


.. Parameters ..

void psi::C_DGBMV ( char  trans,
int  m,
int  n,
int  kl,
int  ku,
double  alpha,
double *  a,
int  lda,
double *  x,
int  incx,
double  beta,
double *  y,
int  incy 
)

Purpose

DGBMV performs one of the matrix-vector operations

y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,

where alpha and beta are scalars, x and y are vectors and A is an m by n band matrix, with kl sub-diagonals and ku super-diagonals.

Arguments

TRANS - CHARACTER*1. On entry, TRANS specifies the operation to be performed as follows:

TRANS = 'N' or 'n' y := alpha*A*x + beta*y.

TRANS = 'T' or 't' y := alpha*A'*x + beta*y.

TRANS = 'C' or 'c' y := alpha*A'*x + beta*y.

Unchanged on exit.

M - INTEGER. On entry, M specifies the number of rows of the matrix A. M must be at least zero. Unchanged on exit.

N - INTEGER. On entry, N specifies the number of columns of the matrix A. N must be at least zero. Unchanged on exit.

KL - INTEGER. On entry, KL specifies the number of sub-diagonals of the matrix A. KL must satisfy 0 .le. KL. Unchanged on exit.

KU - INTEGER. On entry, KU specifies the number of super-diagonals of the matrix A. KU must satisfy 0 .le. KU. Unchanged on exit.

ALPHA - DOUBLE PRECISION. On entry, ALPHA specifies the scalar alpha. Unchanged on exit.

A - DOUBLE PRECISION array of DIMENSION ( LDA, n ). Before entry, the leading ( kl + ku + 1 ) by n part of the array A must contain the matrix of coefficients, supplied column by column, with the leading diagonal of the matrix in row ( ku + 1 ) of the array, the first super-diagonal starting at position 2 in row ku, the first sub-diagonal starting at position 1 in row ( ku + 2 ), and so on. Elements in the array A that do not correspond to elements in the band matrix (such as the top left ku by ku triangle) are not referenced. The following program segment will transfer a band matrix from conventional full matrix storage to band storage:

  DO 20, J = 1, N
     K = KU + 1 - J
     DO 10, I = MAX( 1, J - KU ), MIN( M, J + KL )
        A( K + I, J ) = matrix( I, J )

10 CONTINUE 20 CONTINUE

Unchanged on exit.

LDA - INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. LDA must be at least ( kl + ku + 1 ). Unchanged on exit.

X - DOUBLE PRECISION array of DIMENSION at least ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n' and at least ( 1 + ( m - 1 )*abs( INCX ) ) otherwise. Before entry, the incremented array X must contain the vector x. Unchanged on exit.

INCX - INTEGER. On entry, INCX specifies the increment for the elements of X. INCX must not be zero. Unchanged on exit.

BETA - DOUBLE PRECISION. On entry, BETA specifies the scalar beta. When BETA is supplied as zero then Y need not be set on input. Unchanged on exit.

Y - DOUBLE PRECISION array of DIMENSION at least ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n' and at least ( 1 + ( n - 1 )*abs( INCY ) ) otherwise. Before entry, the incremented array Y must contain the vector y. On exit, Y is overwritten by the updated vector y.

INCY - INTEGER. On entry, INCY specifies the increment for the elements of Y. INCY must not be zero. Unchanged on exit.

Level 2 Blas routine.

– Written on 22-October-1986. Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office. Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs.

.. Parameters ..

int psi::C_DGBRFS ( char  trans,
int  n,
int  kl,
int  ku,
int  nrhs,
double *  ab,
int  ldab,
double *  afb,
int  ldafb,
int *  ipiv,
double *  b,
int  ldb,
double *  x,
int  ldx,
double *  ferr,
double *  berr,
double *  work,
int *  iwork 
)

Purpose

DGBRFS improves the computed solution to a system of linear equations when the coefficient matrix is banded, and provides error bounds and backward error estimates for the solution.

Arguments

TRANS (input) CHARACTER*1 Specifies the form of the system of equations: = 'N': A * X = B (No transpose) = 'T': A**T * X = B (Transpose) = 'C': A**H * X = B (Conjugate transpose = Transpose)

N (input) INTEGER The order of the matrix A. N >= 0.

KL (input) INTEGER The number of subdiagonals within the band of A. KL >= 0.

KU (input) INTEGER The number of superdiagonals within the band of A. KU >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.

AB (input) DOUBLE PRECISION array, dimension (LDAB,N) The original band matrix A, stored in rows 1 to KL+KU+1. The j-th column of A is stored in the j-th column of the array AB as follows: AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).

LDAB (input) INTEGER The leading dimension of the array AB. LDAB >= KL+KU+1.

AFB (input) DOUBLE PRECISION array, dimension (LDAFB,N) Details of the LU factorization of the band matrix A, as computed by DGBTRF. U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1.

LDAFB (input) INTEGER The leading dimension of the array AFB. LDAFB >= 2*KL*KU+1.

IPIV (input) INTEGER array, dimension (N) The pivot indices from DGBTRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).

B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) The right hand side matrix B.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

X (input/output) DOUBLE PRECISION array, dimension (LDX,NRHS) On entry, the solution matrix X, as computed by DGBTRS. On exit, the improved solution matrix X.

LDX (input) INTEGER The leading dimension of the array X. LDX >= max(1,N).

FERR (output) DOUBLE PRECISION array, dimension (NRHS) The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error.

BERR (output) DOUBLE PRECISION array, dimension (NRHS) The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

WORK (workspace) DOUBLE PRECISION array, dimension (3*N)

IWORK (workspace) INTEGER array, dimension (N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value

Internal Parameters

ITMAX is the maximum number of steps of iterative refinement.


.. Parameters ..

int psi::C_DGBSV ( int  n,
int  kl,
int  ku,
int  nrhs,
double *  ab,
int  ldab,
int *  ipiv,
double *  b,
int  ldb 
)

Purpose

DGBSV computes the solution to a real system of linear equations A * X = B, where A is a band matrix of order N with KL subdiagonals and KU superdiagonals, and X and B are N-by-NRHS matrices.

The LU decomposition with partial pivoting and row interchanges is used to factor A as A = L * U, where L is a product of permutation and unit lower triangular matrices with KL subdiagonals, and U is upper triangular with KL+KU superdiagonals. The factored form of A is then used to solve the system of equations A * X = B.

Arguments

N (input) INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0.

KL (input) INTEGER The number of subdiagonals within the band of A. KL >= 0.

KU (input) INTEGER The number of superdiagonals within the band of A. KU >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

AB (input/output) DOUBLE PRECISION array, dimension (LDAB,N) On entry, the matrix A in band storage, in rows KL+1 to 2*KL+KU+1; rows 1 to KL of the array need not be set. The j-th column of A is stored in the j-th column of the array AB as follows: AB(KL+KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+KL) On exit, details of the factorization: U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1. See below for further details.

LDAB (input) INTEGER The leading dimension of the array AB. LDAB >= 2*KL+KU+1.

IPIV (output) INTEGER array, dimension (N) The pivot indices that define the permutation matrix P; row i of the matrix was interchanged with row IPIV(i).

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the N-by-NRHS right hand side matrix B. On exit, if INFO = 0, the N-by-NRHS solution matrix X.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and the solution has not been computed.

Further Details

The band storage scheme is illustrated by the following example, when M = N = 6, KL = 2, KU = 1:

On entry: On exit:

*    *    *    +    +    +       *    *    *   u14  u25  u36
*    *    +    +    +    +       *    *   u13  u24  u35  u46
*   a12  a23  a34  a45  a56      *   u12  u23  u34  u45  u56

a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66 a21 a32 a43 a54 a65 * m21 m32 m43 m54 m65 * a31 a42 a53 a64 * * m31 m42 m53 m64 * *

Array elements marked * are not used by the routine; elements marked

  • need not be set on entry, but are required by the routine to store elements of U because of fill-in resulting from the row interchanges.


    .. External Subroutines ..

int psi::C_DGBSVX ( char  fact,
char  trans,
int  n,
int  kl,
int  ku,
int  nrhs,
double *  ab,
int  ldab,
double *  afb,
int  ldafb,
int *  ipiv,
char  equed,
double *  r,
double *  c,
double *  b,
int  ldb,
double *  x,
int  ldx,
double *  rcond,
double *  ferr,
double *  berr,
double *  work,
int *  iwork 
)

Purpose

DGBSVX uses the LU factorization to compute the solution to a real system of linear equations A * X = B, A**T * X = B, or A**H * X = B, where A is a band matrix of order N with KL subdiagonals and KU superdiagonals, and X and B are N-by-NRHS matrices.

Error bounds on the solution and a condition estimate are also provided.

Description

The following steps are performed by this subroutine:

  1. If FACT = 'E', real scaling factors are computed to equilibrate the system: TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N') or diag(C)*B (if TRANS = 'T' or 'C').
  2. If FACT = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if FACT = 'E') as A = L * U, where L is a product of permutation and unit lower triangular matrices with KL subdiagonals, and U is upper triangular with KL+KU superdiagonals.
  3. If some U(i,i)=0, so that U is exactly singular, then the routine returns with INFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, C++ Return value: INFO (output) INTEGER to solve for X and compute error bounds as described below.
  4. The system of equations is solved for X using the factored form of A.
  5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
  6. If equilibration was used, the matrix X is premultiplied by diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so that it solves the original system before equilibration.

Arguments

FACT (input) CHARACTER*1 Specifies whether or not the factored form of the matrix A is supplied on entry, and if not, whether the matrix A should be equilibrated before it is factored. = 'F': On entry, AFB and IPIV contain the factored form of A. If EQUED is not 'N', the matrix A has been equilibrated with scaling factors given by R and C. AB, AFB, and IPIV are not modified. = 'N': The matrix A will be copied to AFB and factored. = 'E': The matrix A will be equilibrated if necessary, then copied to AFB and factored.

TRANS (input) CHARACTER*1 Specifies the form of the system of equations. = 'N': A * X = B (No transpose) = 'T': A**T * X = B (Transpose) = 'C': A**H * X = B (Transpose)

N (input) INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0.

KL (input) INTEGER The number of subdiagonals within the band of A. KL >= 0.

KU (input) INTEGER The number of superdiagonals within the band of A. KU >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.

AB (input/output) DOUBLE PRECISION array, dimension (LDAB,N) On entry, the matrix A in band storage, in rows 1 to KL+KU+1. The j-th column of A is stored in the j-th column of the array AB as follows: AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl)

If FACT = 'F' and EQUED is not 'N', then A must have been equilibrated by the scaling factors in R and/or C. AB is not modified if FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.

On exit, if EQUED .ne. 'N', A is scaled as follows: EQUED = 'R': A := diag(R) * A EQUED = 'C': A := A * diag(C) EQUED = 'B': A := diag(R) * A * diag(C).

LDAB (input) INTEGER The leading dimension of the array AB. LDAB >= KL+KU+1.

AFB (input or output) DOUBLE PRECISION array, dimension (LDAFB,N) If FACT = 'F', then AFB is an input argument and on entry contains details of the LU factorization of the band matrix A, as computed by DGBTRF. U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1. If EQUED .ne. 'N', then AFB is the factored form of the equilibrated matrix A.

If FACT = 'N', then AFB is an output argument and on exit returns details of the LU factorization of A.

If FACT = 'E', then AFB is an output argument and on exit returns details of the LU factorization of the equilibrated matrix A (see the description of AB for the form of the equilibrated matrix).

LDAFB (input) INTEGER The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1.

IPIV (input or output) INTEGER array, dimension (N) If FACT = 'F', then IPIV is an input argument and on entry contains the pivot indices from the factorization A = L*U as computed by DGBTRF; row i of the matrix was interchanged with row IPIV(i).

If FACT = 'N', then IPIV is an output argument and on exit contains the pivot indices from the factorization A = L*U of the original matrix A.

If FACT = 'E', then IPIV is an output argument and on exit contains the pivot indices from the factorization A = L*U of the equilibrated matrix A.

EQUED (input or output) CHARACTER*1 Specifies the form of equilibration that was done. = 'N': No equilibration (always true if FACT = 'N'). = 'R': Row equilibration, i.e., A has been premultiplied by diag(R). = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C). = 'B': Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C). EQUED is an input argument if FACT = 'F'; otherwise, it is an output argument.

R (input or output) DOUBLE PRECISION array, dimension (N) The row scale factors for A. If EQUED = 'R' or 'B', A is multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is not accessed. R is an input argument if FACT = 'F'; otherwise, R is an output argument. If FACT = 'F' and EQUED = 'R' or 'B', each element of R must be positive.

C (input or output) DOUBLE PRECISION array, dimension (N) The column scale factors for A. If EQUED = 'C' or 'B', A is multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is not accessed. C is an input argument if FACT = 'F'; otherwise, C is an output argument. If FACT = 'F' and EQUED = 'C' or 'B', each element of C must be positive.

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the right hand side matrix B. On exit, if EQUED = 'N', B is not modified; if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by diag(R)*B; if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is overwritten by diag(C)*B.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

X (output) DOUBLE PRECISION array, dimension (LDX,NRHS) If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X to the original system of equations. Note that A and B are modified on exit if EQUED .ne. 'N', and the solution to the equilibrated system is inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B', or inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.

LDX (input) INTEGER The leading dimension of the array X. LDX >= max(1,N).

RCOND (output) DOUBLE PRECISION The estimate of the reciprocal condition number of the matrix A after equilibration (if done). If RCOND is less than the machine precision (in particular, if RCOND = 0), the matrix is singular to working precision. This condition is indicated by a return code of INFO > 0.

FERR (output) DOUBLE PRECISION array, dimension (NRHS) The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error.

BERR (output) DOUBLE PRECISION array, dimension (NRHS) The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

WORK (workspace/output) DOUBLE PRECISION array, dimension (3*N) On exit, WORK(1) contains the reciprocal pivot growth factor norm(A)/norm(U). The "max absolute element" norm is used. If WORK(1) is much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor. This also means that the solution X, condition estimator RCOND, and forward error bound FERR could be unreliable. If factorization fails with 0<INFO<=N, then WORK(1) contains the reciprocal pivot growth factor for the leading INFO columns of A.

IWORK (workspace) INTEGER array, dimension (N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, and i is <= N: U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed. RCOND = 0 is returned. = N+1: U is nonsingular, but RCOND is less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value of RCOND would suggest.


.. Parameters ..

int psi::C_DGBTRF ( int  m,
int  n,
int  kl,
int  ku,
double *  ab,
int  ldab,
int *  ipiv 
)

Purpose

DGBTRF computes an LU factorization of a real m-by-n band matrix A using partial pivoting with row interchanges.

This is the blocked version of the algorithm, calling Level 3 BLAS.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

KL (input) INTEGER The number of subdiagonals within the band of A. KL >= 0.

KU (input) INTEGER The number of superdiagonals within the band of A. KU >= 0.

AB (input/output) DOUBLE PRECISION array, dimension (LDAB,N) On entry, the matrix A in band storage, in rows KL+1 to 2*KL+KU+1; rows 1 to KL of the array need not be set. The j-th column of A is stored in the j-th column of the array AB as follows: AB(kl+ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl)

On exit, details of the factorization: U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1. See below for further details.

LDAB (input) INTEGER The leading dimension of the array AB. LDAB >= 2*KL+KU+1.

IPIV (output) INTEGER array, dimension (min(M,N)) The pivot indices; for 1 <= i <= min(M,N), row i of the matrix was interchanged with row IPIV(i).

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = +i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.

Further Details

The band storage scheme is illustrated by the following example, when M = N = 6, KL = 2, KU = 1:

On entry: On exit:

*    *    *    +    +    +       *    *    *   u14  u25  u36
*    *    +    +    +    +       *    *   u13  u24  u35  u46
*   a12  a23  a34  a45  a56      *   u12  u23  u34  u45  u56

a11 a22 a33 a44 a55 a66 u11 u22 u33 u44 u55 u66 a21 a32 a43 a54 a65 * m21 m32 m43 m54 m65 * a31 a42 a53 a64 * * m31 m42 m53 m64 * *

Array elements marked * are not used by the routine; elements marked

  • need not be set on entry, but are required by the routine to store elements of U because of fill-in resulting from the row interchanges.


    .. Parameters ..

int psi::C_DGBTRS ( char  trans,
int  n,
int  kl,
int  ku,
int  nrhs,
double *  ab,
int  ldab,
int *  ipiv,
double *  b,
int  ldb 
)

Purpose

DGBTRS solves a system of linear equations A * X = B or A' * X = B with a general band matrix A using the LU factorization computed by DGBTRF.

Arguments

TRANS (input) CHARACTER*1 Specifies the form of the system of equations. = 'N': A * X = B (No transpose) = 'T': A'* X = B (Transpose) = 'C': A'* X = B (Conjugate transpose = Transpose)

N (input) INTEGER The order of the matrix A. N >= 0.

KL (input) INTEGER The number of subdiagonals within the band of A. KL >= 0.

KU (input) INTEGER The number of superdiagonals within the band of A. KU >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

AB (input) DOUBLE PRECISION array, dimension (LDAB,N) Details of the LU factorization of the band matrix A, as computed by DGBTRF. U is stored as an upper triangular band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and the multipliers used during the factorization are stored in rows KL+KU+2 to 2*KL+KU+1.

LDAB (input) INTEGER The leading dimension of the array AB. LDAB >= 2*KL+KU+1.

IPIV (input) INTEGER array, dimension (N) The pivot indices; for 1 <= i <= N, row i of the matrix was interchanged with row IPIV(i).

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value


.. Parameters ..

int psi::C_DGEBAK ( char  job,
char  side,
int  n,
int  ilo,
int  ihi,
double *  scale,
int  m,
double *  v,
int  ldv 
)

Purpose

DGEBAK forms the right or left eigenvectors of a real general matrix by backward transformation on the computed eigenvectors of the balanced matrix output by DGEBAL.

Arguments

JOB (input) CHARACTER*1 Specifies the type of backward transformation required: = 'N', do nothing, return immediately; = 'P', do backward transformation for permutation only; = 'S', do backward transformation for scaling only; = 'B', do backward transformations for both permutation and scaling. JOB must be the same as the argument JOB supplied to DGEBAL.

SIDE (input) CHARACTER*1 = 'R': V contains right eigenvectors; = 'L': V contains left eigenvectors.

N (input) INTEGER The number of rows of the matrix V. N >= 0.

ILO (input) INTEGER IHI (input) INTEGER The integers ILO and IHI determined by DGEBAL. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.

SCALE (input) DOUBLE PRECISION array, dimension (N) Details of the permutation and scaling factors, as returned by DGEBAL.

M (input) INTEGER The number of columns of the matrix V. M >= 0.

V (input/output) DOUBLE PRECISION array, dimension (LDV,M) On entry, the matrix of right or left eigenvectors to be transformed, as returned by DHSEIN or DTREVC. On exit, V is overwritten by the transformed eigenvectors.

LDV (input) INTEGER The leading dimension of the array V. LDV >= max(1,N).

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value.


.. Parameters ..

int psi::C_DGEBAL ( char  job,
int  n,
double *  a,
int  lda,
int *  ilo,
int *  ihi,
double *  scale 
)

Purpose

DGEBAL balances a general real matrix A. This involves, first, permuting A by a similarity transformation to isolate eigenvalues in the first 1 to ILO-1 and last IHI+1 to N elements on the diagonal; and second, applying a diagonal similarity transformation to rows and columns ILO to IHI to make the rows and columns as close in norm as possible. Both steps are optional.

Balancing may reduce the 1-norm of the matrix, and improve the accuracy of the computed eigenvalues and/or eigenvectors.

Arguments

JOB (input) CHARACTER*1 Specifies the operations to be performed on A: = 'N': none: simply set ILO = 1, IHI = N, SCALE(I) = 1.0 for i = 1,...,N; = 'P': permute only; = 'S': scale only; = 'B': both permute and scale.

N (input) INTEGER The order of the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the input matrix A. On exit, A is overwritten by the balanced matrix. If JOB = 'N', A is not referenced. See Further Details.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

ILO (output) INTEGER IHI (output) INTEGER ILO and IHI are set to integers such that on exit A(i,j) = 0 if i > j and j = 1,...,ILO-1 or I = IHI+1,...,N. If JOB = 'N' or 'S', ILO = 1 and IHI = N.

SCALE (output) DOUBLE PRECISION array, dimension (N) Details of the permutations and scaling factors applied to A. If P(j) is the index of the row and column interchanged with row and column j and D(j) is the scaling factor applied to row and column j, then SCALE(j) = P(j) for j = 1,...,ILO-1 = D(j) for j = ILO,...,IHI = P(j) for j = IHI+1,...,N. The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.

C++ Return value: INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value.

Further Details

The permutations consist of row and column interchanges which put the matrix in the form

       ( T1   X   Y  )

P A P = ( 0 B Z ) ( 0 0 T2 )

where T1 and T2 are upper triangular matrices whose eigenvalues lie along the diagonal. The column indices ILO and IHI mark the starting and ending columns of the submatrix B. Balancing consists of applying a diagonal similarity transformation inv(D) * B * D to make the 1-norms of each row of B and its corresponding column nearly equal. The output matrix is

( T1 X*D Y ) ( 0 inv(D)*B*D inv(D)*Z ). ( 0 0 T2 )

Information about the permutations P and the diagonal matrix D is returned in the vector SCALE.

This subroutine is based on the EISPACK routine BALANC.

Modified by Tzu-Yi Chen, Computer Science Division, University of California at Berkeley, USA


.. Parameters ..

int psi::C_DGEBRD ( int  m,
int  n,
double *  a,
int  lda,
double *  d,
double *  e,
double *  tauq,
double *  taup,
double *  work,
int  lwork 
)

Purpose

DGEBRD reduces a general real M-by-N matrix A to upper or lower bidiagonal form B by an orthogonal transformation: Q**T * A * P = B.

If m >= n, B is upper bidiagonal; if m < n, B is lower bidiagonal.

Arguments

M (input) INTEGER The number of rows in the matrix A. M >= 0.

N (input) INTEGER The number of columns in the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N general matrix to be reduced. On exit, if m >= n, the diagonal and the first superdiagonal are overwritten with the upper bidiagonal matrix B; the elements below the diagonal, with the array TAUQ, represent the orthogonal matrix Q as a product of elementary reflectors, and the elements above the first superdiagonal, with the array TAUP, represent the orthogonal matrix P as a product of elementary reflectors; if m < n, the diagonal and the first subdiagonal are overwritten with the lower bidiagonal matrix B; the elements below the first subdiagonal, with the array TAUQ, represent the orthogonal matrix Q as a product of elementary reflectors, and the elements above the diagonal, with the array TAUP, represent the orthogonal matrix P as a product of elementary reflectors. See Further Details.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

D (output) DOUBLE PRECISION array, dimension (min(M,N)) The diagonal elements of the bidiagonal matrix B: D(i) = A(i,i).

E (output) DOUBLE PRECISION array, dimension (min(M,N)-1) The off-diagonal elements of the bidiagonal matrix B: if m >= n, E(i) = A(i,i+1) for i = 1,2,...,n-1; if m < n, E(i) = A(i+1,i) for i = 1,2,...,m-1.

TAUQ (output) DOUBLE PRECISION array dimension (min(M,N)) The scalar factors of the elementary reflectors which represent the orthogonal matrix Q. See Further Details.

TAUP (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors which represent the orthogonal matrix P. See Further Details.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The length of the array WORK. LWORK >= max(1,M,N). For optimum performance LWORK >= (M+N)*NB, where NB is the optimal blocksize.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value.

Further Details

The matrices Q and P are represented as products of elementary reflectors:

If m >= n,

Q = H(1) H(2) . . . H(n) and P = G(1) G(2) . . . G(n-1)

Each H(i) and G(i) has the form:

H(i) = I - tauq * v * v' and G(i) = I - taup * u * u'

where tauq and taup are real scalars, and v and u are real vectors; v(1:i-1) = 0, v(i) = 1, and v(i+1:m) is stored on exit in A(i+1:m,i); u(1:i) = 0, u(i+1) = 1, and u(i+2:n) is stored on exit in A(i,i+2:n); tauq is stored in TAUQ(i) and taup in TAUP(i).

If m < n,

Q = H(1) H(2) . . . H(m-1) and P = G(1) G(2) . . . G(m)

Each H(i) and G(i) has the form:

H(i) = I - tauq * v * v' and G(i) = I - taup * u * u'

where tauq and taup are real scalars, and v and u are real vectors; v(1:i) = 0, v(i+1) = 1, and v(i+2:m) is stored on exit in A(i+2:m,i); u(1:i-1) = 0, u(i) = 1, and u(i+1:n) is stored on exit in A(i,i+1:n); tauq is stored in TAUQ(i) and taup in TAUP(i).

The contents of A on exit are illustrated by the following examples:

m = 6 and n = 5 (m > n): m = 5 and n = 6 (m < n):

( d e u1 u1 u1 ) ( d u1 u1 u1 u1 u1 ) ( v1 d e u2 u2 ) ( e d u2 u2 u2 u2 ) ( v1 v2 d e u3 ) ( v1 e d u3 u3 u3 ) ( v1 v2 v3 d e ) ( v1 v2 e d u4 u4 ) ( v1 v2 v3 v4 d ) ( v1 v2 v3 e d u5 ) ( v1 v2 v3 v4 v5 )

where d and e denote diagonal and off-diagonal elements of B, vi denotes an element of the vector defining H(i), and ui an element of the vector defining G(i).


.. Parameters ..

int psi::C_DGECON ( char  norm,
int  n,
double *  a,
int  lda,
double  anorm,
double *  rcond,
double *  work,
int *  iwork 
)

Purpose

DGECON estimates the reciprocal of the condition number of a general real matrix A, in either the 1-norm or the infinity-norm, using the LU factorization computed by DGETRF.

An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as RCOND = 1 / ( norm(A) * norm(inv(A)) ).

Arguments

NORM (input) CHARACTER*1 Specifies whether the 1-norm condition number or the infinity-norm condition number is required: = '1' or 'O': 1-norm; = 'I': Infinity-norm.

N (input) INTEGER The order of the matrix A. N >= 0.

A (input) DOUBLE PRECISION array, dimension (LDA,N) The factors L and U from the factorization A = P*L*U as computed by DGETRF.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

ANORM (input) DOUBLE PRECISION If NORM = '1' or 'O', the 1-norm of the original matrix A. If NORM = 'I', the infinity-norm of the original matrix A.

RCOND (output) DOUBLE PRECISION The reciprocal of the condition number of the matrix A, computed as RCOND = 1/(norm(A) * norm(inv(A))).

WORK (workspace) DOUBLE PRECISION array, dimension (4*N)

IWORK (workspace) INTEGER array, dimension (N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value


.. Parameters ..

int psi::C_DGEEQU ( int  m,
int  n,
double *  a,
int  lda,
double *  r,
double *  c,
double *  rowcnd,
double *  colcnd,
double *  amax 
)

Purpose

DGEEQU computes row and column scalings intended to equilibrate an M-by-N matrix A and reduce its condition number. R returns the row scale factors and C the column scale factors, chosen to try to make the largest element in each row and column of the matrix B with elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

R(i) and C(j) are restricted to be between SMLNUM = smallest safe number and BIGNUM = largest safe number. Use of these scaling factors is not guaranteed to reduce the condition number of A but works well in practice.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

A (input) DOUBLE PRECISION array, dimension (LDA,N) The M-by-N matrix whose equilibration factors are to be computed.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

R (output) DOUBLE PRECISION array, dimension (M) If INFO = 0 or INFO > M, R contains the row scale factors for A.

C (output) DOUBLE PRECISION array, dimension (N) If INFO = 0, C contains the column scale factors for A.

ROWCND (output) DOUBLE PRECISION If INFO = 0 or INFO > M, ROWCND contains the ratio of the smallest R(i) to the largest R(i). If ROWCND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by R.

COLCND (output) DOUBLE PRECISION If INFO = 0, COLCND contains the ratio of the smallest C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.

AMAX (output) DOUBLE PRECISION Absolute value of largest matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, and i is <= M: the i-th row of A is exactly zero > M: the (i-M)-th column of A is exactly zero


.. Parameters ..

int psi::C_DGEES ( char  jobvs,
char  sort,
int  n,
double *  a,
int  lda,
int *  sdim,
double *  wr,
double *  wi,
double *  vs,
int  ldvs,
double *  work,
int  lwork 
)

Purpose

DGEES computes for an N-by-N real nonsymmetric matrix A, the eigenvalues, the real Schur form T, and, optionally, the matrix of Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**T).

Optionally, it also orders the eigenvalues on the diagonal of the real Schur form so that selected eigenvalues are at the top left. The leading columns of Z then form an orthonormal basis for the invariant subspace corresponding to the selected eigenvalues.

A matrix is in real Schur form if it is upper quasi-triangular with 1-by-1 and 2-by-2 blocks. 2-by-2 blocks will be standardized in the form [ a b ] [ c a ]

where b*c < 0. The eigenvalues of such a block are a +- sqrt(bc).

Arguments

JOBVS (input) CHARACTER*1 = 'N': Schur vectors are not computed; = 'V': Schur vectors are computed.

SORT (input) CHARACTER*1 Specifies whether or not to order the eigenvalues on the diagonal of the Schur form. = 'N': Eigenvalues are not ordered; = 'S': Eigenvalues are ordered (see SELECT).

SELECT (external procedure) LOGICAL FUNCTION of two DOUBLE PRECISION arguments SELECT must be declared EXTERNAL in the calling subroutine. If SORT = 'S', SELECT is used to select eigenvalues to sort to the top left of the Schur form. If SORT = 'N', SELECT is not referenced. An eigenvalue WR(j)+sqrt(-1)*WI(j) is selected if SELECT(WR(j),WI(j)) is true; i.e., if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected. Note that a selected complex eigenvalue may no longer satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned); in this case INFO is set to N+2 (see INFO below).

N (input) INTEGER The order of the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the N-by-N matrix A. On exit, A has been overwritten by its real Schur form T.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

SDIM (output) INTEGER If SORT = 'N', SDIM = 0. If SORT = 'S', SDIM = number of eigenvalues (after sorting) for which SELECT is true. (Complex conjugate pairs for which SELECT is true for either eigenvalue count as 2.)

WR (output) DOUBLE PRECISION array, dimension (N) WI (output) DOUBLE PRECISION array, dimension (N) WR and WI contain the real and imaginary parts, respectively, of the computed eigenvalues in the same order that they appear on the diagonal of the output Schur form T. Complex conjugate pairs of eigenvalues will appear consecutively with the eigenvalue having the positive imaginary part first.

VS (output) DOUBLE PRECISION array, dimension (LDVS,N) If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur vectors. If JOBVS = 'N', VS is not referenced.

LDVS (input) INTEGER The leading dimension of the array VS. LDVS >= 1; if JOBVS = 'V', LDVS >= N.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) contains the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,3*N). For good performance, LWORK must generally be larger.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

BWORK (workspace) LOGICAL array, dimension (N) Not referenced if SORT = 'N'.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. > 0: if INFO = i, and i is <= N: the QR algorithm failed to compute all the eigenvalues; elements 1:ILO-1 and i+1:N of WR and WI contain those eigenvalues which have converged; if JOBVS = 'V', VS contains the matrix which reduces A to its partially converged Schur form. = N+1: the eigenvalues could not be reordered because some eigenvalues were too close to separate (the problem is very ill-conditioned); = N+2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Schur form no longer satisfy SELECT=.TRUE. This could also be caused by underflow due to scaling.


.. Parameters ..

int psi::C_DGEESX ( char  jobvs,
char  sort,
char  sense,
int  n,
double *  a,
int  lda,
int *  sdim,
double *  wr,
double *  wi,
double *  vs,
int  ldvs,
double *  rconde,
double *  rcondv,
double *  work,
int  lwork,
int *  iwork,
int  liwork 
)

Purpose

DGEESX computes for an N-by-N real nonsymmetric matrix A, the eigenvalues, the real Schur form T, and, optionally, the matrix of Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**T).

Optionally, it also orders the eigenvalues on the diagonal of the real Schur form so that selected eigenvalues are at the top left; computes a reciprocal condition number for the average of the selected eigenvalues (RCONDE); and computes a reciprocal condition number for the right invariant subspace corresponding to the selected eigenvalues (RCONDV). The leading columns of Z form an orthonormal basis for this invariant subspace.

For further explanation of the reciprocal condition numbers RCONDE and RCONDV, see Section 4.10 of the LAPACK Users' Guide (where these quantities are called s and sep respectively).

A real matrix is in real Schur form if it is upper quasi-triangular with 1-by-1 and 2-by-2 blocks. 2-by-2 blocks will be standardized in the form [ a b ] [ c a ]

where b*c < 0. The eigenvalues of such a block are a +- sqrt(bc).

Arguments

JOBVS (input) CHARACTER*1 = 'N': Schur vectors are not computed; = 'V': Schur vectors are computed.

SORT (input) CHARACTER*1 Specifies whether or not to order the eigenvalues on the diagonal of the Schur form. = 'N': Eigenvalues are not ordered; = 'S': Eigenvalues are ordered (see SELECT).

SELECT (external procedure) LOGICAL FUNCTION of two DOUBLE PRECISION arguments SELECT must be declared EXTERNAL in the calling subroutine. If SORT = 'S', SELECT is used to select eigenvalues to sort to the top left of the Schur form. If SORT = 'N', SELECT is not referenced. An eigenvalue WR(j)+sqrt(-1)*WI(j) is selected if SELECT(WR(j),WI(j)) is true; i.e., if either one of a complex conjugate pair of eigenvalues is selected, then both are. Note that a selected complex eigenvalue may no longer satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned); in this case INFO may be set to N+3 (see INFO below).

SENSE (input) CHARACTER*1 Determines which reciprocal condition numbers are computed. = 'N': None are computed; = 'E': Computed for average of selected eigenvalues only; = 'V': Computed for selected right invariant subspace only; = 'B': Computed for both. If SENSE = 'E', 'V' or 'B', SORT must equal 'S'.

N (input) INTEGER The order of the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA, N) On entry, the N-by-N matrix A. On exit, A is overwritten by its real Schur form T.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

SDIM (output) INTEGER If SORT = 'N', SDIM = 0. If SORT = 'S', SDIM = number of eigenvalues (after sorting) for which SELECT is true. (Complex conjugate pairs for which SELECT is true for either eigenvalue count as 2.)

WR (output) DOUBLE PRECISION array, dimension (N) WI (output) DOUBLE PRECISION array, dimension (N) WR and WI contain the real and imaginary parts, respectively, of the computed eigenvalues, in the same order that they appear on the diagonal of the output Schur form T. Complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first.

VS (output) DOUBLE PRECISION array, dimension (LDVS,N) If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur vectors. If JOBVS = 'N', VS is not referenced.

LDVS (input) INTEGER The leading dimension of the array VS. LDVS >= 1, and if JOBVS = 'V', LDVS >= N.

RCONDE (output) DOUBLE PRECISION If SENSE = 'E' or 'B', RCONDE contains the reciprocal condition number for the average of the selected eigenvalues. Not referenced if SENSE = 'N' or 'V'.

RCONDV (output) DOUBLE PRECISION If SENSE = 'V' or 'B', RCONDV contains the reciprocal condition number for the selected right invariant subspace. Not referenced if SENSE = 'N' or 'E'.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,3*N). Also, if SENSE = 'E' or 'V' or 'B', LWORK >= N+2*SDIM*(N-SDIM), where SDIM is the number of selected eigenvalues computed by this routine. Note that N+2*SDIM*(N-SDIM) <= N+N*N/2. Note also that an error is only returned if LWORK < max(1,3*N), but if SENSE = 'E' or 'V' or 'B' this may not be large enough. For good performance, LWORK must generally be larger.

If LWORK = -1, then a workspace query is assumed; the routine only calculates upper bounds on the optimal sizes of the arrays WORK and IWORK, returns these values as the first entries of the WORK and IWORK arrays, and no error messages related to LWORK or LIWORK are issued by XERBLA.

IWORK (workspace/output) INTEGER array, dimension (MAX(1,LIWORK)) On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.

LIWORK (input) INTEGER The dimension of the array IWORK. LIWORK >= 1; if SENSE = 'V' or 'B', LIWORK >= SDIM*(N-SDIM). Note that SDIM*(N-SDIM) <= N*N/4. Note also that an error is only returned if LIWORK < 1, but if SENSE = 'V' or 'B' this may not be large enough.

If LIWORK = -1, then a workspace query is assumed; the routine only calculates upper bounds on the optimal sizes of the arrays WORK and IWORK, returns these values as the first entries of the WORK and IWORK arrays, and no error messages related to LWORK or LIWORK are issued by XERBLA.

BWORK (workspace) LOGICAL array, dimension (N) Not referenced if SORT = 'N'.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. > 0: if INFO = i, and i is <= N: the QR algorithm failed to compute all the eigenvalues; elements 1:ILO-1 and i+1:N of WR and WI contain those eigenvalues which have converged; if JOBVS = 'V', VS contains the transformation which reduces A to its partially converged Schur form. = N+1: the eigenvalues could not be reordered because some eigenvalues were too close to separate (the problem is very ill-conditioned); = N+2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Schur form no longer satisfy SELECT=.TRUE. This could also be caused by underflow due to scaling.


.. Parameters ..

int psi::C_DGEEV ( char  jobvl,
char  jobvr,
int  n,
double *  a,
int  lda,
double *  wr,
double *  wi,
double *  vl,
int  ldvl,
double *  vr,
int  ldvr,
double *  work,
int  lwork 
)

Purpose

DGEEV computes for an N-by-N real nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or right eigenvectors.

The right eigenvector v(j) of A satisfies A * v(j) = lambda(j) * v(j) where lambda(j) is its eigenvalue. The left eigenvector u(j) of A satisfies u(j)**H * A = lambda(j) * u(j)**H where u(j)**H denotes the conjugate transpose of u(j).

The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.

Arguments

JOBVL (input) CHARACTER*1 = 'N': left eigenvectors of A are not computed; = 'V': left eigenvectors of A are computed.

JOBVR (input) CHARACTER*1 = 'N': right eigenvectors of A are not computed; = 'V': right eigenvectors of A are computed.

N (input) INTEGER The order of the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the N-by-N matrix A. On exit, A has been overwritten.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

WR (output) DOUBLE PRECISION array, dimension (N) WI (output) DOUBLE PRECISION array, dimension (N) WR and WI contain the real and imaginary parts, respectively, of the computed eigenvalues. Complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first.

VL (output) DOUBLE PRECISION array, dimension (LDVL,N) If JOBVL = 'V', the left eigenvectors u(j) are stored one after another in the columns of VL, in the same order as their eigenvalues. If JOBVL = 'N', VL is not referenced. If the j-th eigenvalue is real, then u(j) = VL(:,j), the j-th column of VL. If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and u(j+1) = VL(:,j) - i*VL(:,j+1).

LDVL (input) INTEGER The leading dimension of the array VL. LDVL >= 1; if JOBVL = 'V', LDVL >= N.

VR (output) DOUBLE PRECISION array, dimension (LDVR,N) If JOBVR = 'V', the right eigenvectors v(j) are stored one after another in the columns of VR, in the same order as their eigenvalues. If JOBVR = 'N', VR is not referenced. If the j-th eigenvalue is real, then v(j) = VR(:,j), the j-th column of VR. If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and v(j+1) = VR(:,j) - i*VR(:,j+1).

LDVR (input) INTEGER The leading dimension of the array VR. LDVR >= 1; if JOBVR = 'V', LDVR >= N.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,3*N), and if JOBVL = 'V' or JOBVR = 'V', LWORK >= 4*N. For good performance, LWORK must generally be larger.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. > 0: if INFO = i, the QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed; elements i+1:N of WR and WI contain eigenvalues which have converged.


.. Parameters ..

int psi::C_DGEEVX ( char  balanc,
char  jobvl,
char  jobvr,
char  sense,
int  n,
double *  a,
int  lda,
double *  wr,
double *  wi,
double *  vl,
int  ldvl,
double *  vr,
int  ldvr,
int *  ilo,
int *  ihi,
double *  scale,
double *  abnrm,
double *  rconde,
double *  rcondv,
double *  work,
int  lwork,
int *  iwork 
)

Purpose

DGEEVX computes for an N-by-N real nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or right eigenvectors.

Optionally also, it computes a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors (ILO, IHI, SCALE, and ABNRM), reciprocal condition numbers for the eigenvalues (RCONDE), and reciprocal condition numbers for the right eigenvectors (RCONDV).

The right eigenvector v(j) of A satisfies A * v(j) = lambda(j) * v(j) where lambda(j) is its eigenvalue. The left eigenvector u(j) of A satisfies u(j)**H * A = lambda(j) * u(j)**H where u(j)**H denotes the conjugate transpose of u(j).

The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.

Balancing a matrix means permuting the rows and columns to make it more nearly upper triangular, and applying a diagonal similarity transformation D * A * D**(-1), where D is a diagonal matrix, to make its rows and columns closer in norm and the condition numbers of its eigenvalues and eigenvectors smaller. The computed reciprocal condition numbers correspond to the balanced matrix. Permuting rows and columns will not change the condition numbers (in exact arithmetic) but diagonal scaling will. For further explanation of balancing, see section 4.10.2 of the LAPACK Users' Guide.

Arguments

BALANC (input) CHARACTER*1 Indicates how the input matrix should be diagonally scaled and/or permuted to improve the conditioning of its eigenvalues. = 'N': Do not diagonally scale or permute; = 'P': Perform permutations to make the matrix more nearly upper triangular. Do not diagonally scale; = 'S': Diagonally scale the matrix, i.e. replace A by D*A*D**(-1), where D is a diagonal matrix chosen to make the rows and columns of A more equal in norm. Do not permute; = 'B': Both diagonally scale and permute A.

Computed reciprocal condition numbers will be for the matrix after balancing and/or permuting. Permuting does not change condition numbers (in exact arithmetic), but balancing does.

JOBVL (input) CHARACTER*1 = 'N': left eigenvectors of A are not computed; = 'V': left eigenvectors of A are computed. If SENSE = 'E' or 'B', JOBVL must = 'V'.

JOBVR (input) CHARACTER*1 = 'N': right eigenvectors of A are not computed; = 'V': right eigenvectors of A are computed. If SENSE = 'E' or 'B', JOBVR must = 'V'.

SENSE (input) CHARACTER*1 Determines which reciprocal condition numbers are computed. = 'N': None are computed; = 'E': Computed for eigenvalues only; = 'V': Computed for right eigenvectors only; = 'B': Computed for eigenvalues and right eigenvectors.

If SENSE = 'E' or 'B', both left and right eigenvectors must also be computed (JOBVL = 'V' and JOBVR = 'V').

N (input) INTEGER The order of the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the N-by-N matrix A. On exit, A has been overwritten. If JOBVL = 'V' or JOBVR = 'V', A contains the real Schur form of the balanced version of the input matrix A.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

WR (output) DOUBLE PRECISION array, dimension (N) WI (output) DOUBLE PRECISION array, dimension (N) WR and WI contain the real and imaginary parts, respectively, of the computed eigenvalues. Complex conjugate pairs of eigenvalues will appear consecutively with the eigenvalue having the positive imaginary part first.

VL (output) DOUBLE PRECISION array, dimension (LDVL,N) If JOBVL = 'V', the left eigenvectors u(j) are stored one after another in the columns of VL, in the same order as their eigenvalues. If JOBVL = 'N', VL is not referenced. If the j-th eigenvalue is real, then u(j) = VL(:,j), the j-th column of VL. If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and u(j+1) = VL(:,j) - i*VL(:,j+1).

LDVL (input) INTEGER The leading dimension of the array VL. LDVL >= 1; if JOBVL = 'V', LDVL >= N.

VR (output) DOUBLE PRECISION array, dimension (LDVR,N) If JOBVR = 'V', the right eigenvectors v(j) are stored one after another in the columns of VR, in the same order as their eigenvalues. If JOBVR = 'N', VR is not referenced. If the j-th eigenvalue is real, then v(j) = VR(:,j), the j-th column of VR. If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and v(j+1) = VR(:,j) - i*VR(:,j+1).

LDVR (input) INTEGER The leading dimension of the array VR. LDVR >= 1, and if JOBVR = 'V', LDVR >= N.

ILO (output) INTEGER IHI (output) INTEGER ILO and IHI are integer values determined when A was balanced. The balanced A(i,j) = 0 if I > J and J = 1,...,ILO-1 or I = IHI+1,...,N.

SCALE (output) DOUBLE PRECISION array, dimension (N) Details of the permutations and scaling factors applied when balancing A. If P(j) is the index of the row and column interchanged with row and column j, and D(j) is the scaling factor applied to row and column j, then SCALE(J) = P(J), for J = 1,...,ILO-1 = D(J), for J = ILO,...,IHI = P(J) for J = IHI+1,...,N. The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.

ABNRM (output) DOUBLE PRECISION The one-norm of the balanced matrix (the maximum of the sum of absolute values of elements of any column).

RCONDE (output) DOUBLE PRECISION array, dimension (N) RCONDE(j) is the reciprocal condition number of the j-th eigenvalue.

RCONDV (output) DOUBLE PRECISION array, dimension (N) RCONDV(j) is the reciprocal condition number of the j-th right eigenvector.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. If SENSE = 'N' or 'E', LWORK >= max(1,2*N), and if JOBVL = 'V' or JOBVR = 'V', LWORK >= 3*N. If SENSE = 'V' or 'B', LWORK >= N*(N+6). For good performance, LWORK must generally be larger.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

IWORK (workspace) INTEGER array, dimension (2*N-2) If SENSE = 'N' or 'E', not referenced.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. > 0: if INFO = i, the QR algorithm failed to compute all the eigenvalues, and no eigenvectors or condition numbers have been computed; elements 1:ILO-1 and i+1:N of WR and WI contain eigenvalues which have converged.


.. Parameters ..

int psi::C_DGEGS ( char  jobvsl,
char  jobvsr,
int  n,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  alphar,
double *  alphai,
double *  beta,
double *  vsl,
int  ldvsl,
double *  vsr,
int  ldvsr,
double *  work,
int  lwork 
)

Purpose

This routine is deprecated and has been replaced by routine DGGES.

DGEGS computes the eigenvalues, real Schur form, and, optionally, left and or/right Schur vectors of a real matrix pair (A,B). Given two square matrices A and B, the generalized real Schur factorization has the form

A = Q*S*Z**T, B = Q*T*Z**T

where Q and Z are orthogonal matrices, T is upper triangular, and S is an upper quasi-triangular matrix with 1-by-1 and 2-by-2 diagonal blocks, the 2-by-2 blocks corresponding to complex conjugate pairs of eigenvalues of (A,B). The columns of Q are the left Schur vectors and the columns of Z are the right Schur vectors.

If only the eigenvalues of (A,B) are needed, the driver routine DGEGV should be used instead. See DGEGV for a description of the eigenvalues of the generalized nonsymmetric eigenvalue problem (GNEP).

Arguments

JOBVSL (input) CHARACTER*1 = 'N': do not compute the left Schur vectors; = 'V': compute the left Schur vectors (returned in VSL).

JOBVSR (input) CHARACTER*1 = 'N': do not compute the right Schur vectors; = 'V': compute the right Schur vectors (returned in VSR).

N (input) INTEGER The order of the matrices A, B, VSL, and VSR. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA, N) On entry, the matrix A. On exit, the upper quasi-triangular matrix S from the generalized real Schur factorization.

LDA (input) INTEGER The leading dimension of A. LDA >= max(1,N).

B (input/output) DOUBLE PRECISION array, dimension (LDB, N) On entry, the matrix B. On exit, the upper triangular matrix T from the generalized real Schur factorization.

LDB (input) INTEGER The leading dimension of B. LDB >= max(1,N).

ALPHAR (output) DOUBLE PRECISION array, dimension (N) The real parts of each scalar alpha defining an eigenvalue of GNEP.

ALPHAI (output) DOUBLE PRECISION array, dimension (N) The imaginary parts of each scalar alpha defining an eigenvalue of GNEP. If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) = -ALPHAI(j).

BETA (output) DOUBLE PRECISION array, dimension (N) The scalars beta that define the eigenvalues of GNEP. Together, the quantities alpha = (ALPHAR(j),ALPHAI(j)) and beta = BETA(j) represent the j-th eigenvalue of the matrix pair (A,B), in one of the forms lambda = alpha/beta or mu = beta/alpha. Since either lambda or mu may overflow, they should not, in general, be computed.

VSL (output) DOUBLE PRECISION array, dimension (LDVSL,N) If JOBVSL = 'V', the matrix of left Schur vectors Q. Not referenced if JOBVSL = 'N'.

LDVSL (input) INTEGER The leading dimension of the matrix VSL. LDVSL >=1, and if JOBVSL = 'V', LDVSL >= N.

VSR (output) DOUBLE PRECISION array, dimension (LDVSR,N) If JOBVSR = 'V', the matrix of right Schur vectors Z. Not referenced if JOBVSR = 'N'.

LDVSR (input) INTEGER The leading dimension of the matrix VSR. LDVSR >= 1, and if JOBVSR = 'V', LDVSR >= N.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,4*N). For good performance, LWORK must generally be larger. To compute the optimal value of LWORK, call ILAENV to get blocksizes (for DGEQRF, DORMQR, and DORGQR.) Then compute: NB – MAX of the blocksizes for DGEQRF, DORMQR, and DORGQR The optimal LWORK is 2*N + N*(NB+1).

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. = 1,...,N: The QZ iteration failed. (A,B) are not in Schur form, but ALPHAR(j), ALPHAI(j), and BETA(j) should be correct for j=INFO+1,...,N. > N: errors that usually indicate LAPACK problems: =N+1: error return from DGGBAL =N+2: error return from DGEQRF =N+3: error return from DORMQR =N+4: error return from DORGQR =N+5: error return from DGGHRD =N+6: error return from DHGEQZ (other than failed iteration) =N+7: error return from DGGBAK (computing VSL) =N+8: error return from DGGBAK (computing VSR) =N+9: error return from DLASCL (various places)


.. Parameters ..

int psi::C_DGEGV ( char  jobvl,
char  jobvr,
int  n,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  alphar,
double *  alphai,
double *  beta,
double *  vl,
int  ldvl,
double *  vr,
int  ldvr,
double *  work,
int  lwork 
)

Purpose

This routine is deprecated and has been replaced by routine DGGEV.

DGEGV computes the eigenvalues and, optionally, the left and/or right eigenvectors of a real matrix pair (A,B). Given two square matrices A and B, the generalized nonsymmetric eigenvalue problem (GNEP) is to find the eigenvalues lambda and corresponding (non-zero) eigenvectors x such that

A*x = lambda*B*x.

An alternate form is to find the eigenvalues mu and corresponding eigenvectors y such that

mu*A*y = B*y.

These two forms are equivalent with mu = 1/lambda and x = y if neither lambda nor mu is zero. In order to deal with the case that lambda or mu is zero or small, two values alpha and beta are returned for each eigenvalue, such that lambda = alpha/beta and mu = beta/alpha.

The vectors x and y in the above equations are right eigenvectors of the matrix pair (A,B). Vectors u and v satisfying

u**H*A = lambda*u**H*B or mu*v**H*A = v**H*B

are left eigenvectors of (A,B).

Note: this routine performs "full balancing" on A and B – see "Further Details", below.

Arguments

JOBVL (input) CHARACTER*1 = 'N': do not compute the left generalized eigenvectors; = 'V': compute the left generalized eigenvectors (returned in VL).

JOBVR (input) CHARACTER*1 = 'N': do not compute the right generalized eigenvectors; = 'V': compute the right generalized eigenvectors (returned in VR).

N (input) INTEGER The order of the matrices A, B, VL, and VR. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA, N) On entry, the matrix A. If JOBVL = 'V' or JOBVR = 'V', then on exit A contains the real Schur form of A from the generalized Schur factorization of the pair (A,B) after balancing. If no eigenvectors were computed, then only the diagonal blocks from the Schur form will be correct. See DGGHRD and DHGEQZ for details.

LDA (input) INTEGER The leading dimension of A. LDA >= max(1,N).

B (input/output) DOUBLE PRECISION array, dimension (LDB, N) On entry, the matrix B. If JOBVL = 'V' or JOBVR = 'V', then on exit B contains the upper triangular matrix obtained from B in the generalized Schur factorization of the pair (A,B) after balancing. If no eigenvectors were computed, then only those elements of B corresponding to the diagonal blocks from the Schur form of A will be correct. See DGGHRD and DHGEQZ for details.

LDB (input) INTEGER The leading dimension of B. LDB >= max(1,N).

ALPHAR (output) DOUBLE PRECISION array, dimension (N) The real parts of each scalar alpha defining an eigenvalue of GNEP.

ALPHAI (output) DOUBLE PRECISION array, dimension (N) The imaginary parts of each scalar alpha defining an eigenvalue of GNEP. If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) = -ALPHAI(j).

BETA (output) DOUBLE PRECISION array, dimension (N) The scalars beta that define the eigenvalues of GNEP.

Together, the quantities alpha = (ALPHAR(j),ALPHAI(j)) and beta = BETA(j) represent the j-th eigenvalue of the matrix pair (A,B), in one of the forms lambda = alpha/beta or mu = beta/alpha. Since either lambda or mu may overflow, they should not, in general, be computed.

VL (output) DOUBLE PRECISION array, dimension (LDVL,N) If JOBVL = 'V', the left eigenvectors u(j) are stored in the columns of VL, in the same order as their eigenvalues. If the j-th eigenvalue is real, then u(j) = VL(:,j). If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and u(j+1) = VL(:,j) - i*VL(:,j+1).

Each eigenvector is scaled so that its largest component has abs(real part) + abs(imag. part) = 1, except for eigenvectors corresponding to an eigenvalue with alpha = beta = 0, which are set to zero. Not referenced if JOBVL = 'N'.

LDVL (input) INTEGER The leading dimension of the matrix VL. LDVL >= 1, and if JOBVL = 'V', LDVL >= N.

VR (output) DOUBLE PRECISION array, dimension (LDVR,N) If JOBVR = 'V', the right eigenvectors x(j) are stored in the columns of VR, in the same order as their eigenvalues. If the j-th eigenvalue is real, then x(j) = VR(:,j). If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then x(j) = VR(:,j) + i*VR(:,j+1) and x(j+1) = VR(:,j) - i*VR(:,j+1).

Each eigenvector is scaled so that its largest component has abs(real part) + abs(imag. part) = 1, except for eigenvalues corresponding to an eigenvalue with alpha = beta = 0, which are set to zero. Not referenced if JOBVR = 'N'.

LDVR (input) INTEGER The leading dimension of the matrix VR. LDVR >= 1, and if JOBVR = 'V', LDVR >= N.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,8*N). For good performance, LWORK must generally be larger. To compute the optimal value of LWORK, call ILAENV to get blocksizes (for DGEQRF, DORMQR, and DORGQR.) Then compute: NB – MAX of the blocksizes for DGEQRF, DORMQR, and DORGQR; The optimal LWORK is: 2*N + MAX( 6*N, N*(NB+1) ).

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. = 1,...,N: The QZ iteration failed. No eigenvectors have been calculated, but ALPHAR(j), ALPHAI(j), and BETA(j) should be correct for j=INFO+1,...,N. > N: errors that usually indicate LAPACK problems: =N+1: error return from DGGBAL =N+2: error return from DGEQRF =N+3: error return from DORMQR =N+4: error return from DORGQR =N+5: error return from DGGHRD =N+6: error return from DHGEQZ (other than failed iteration) =N+7: error return from DTGEVC =N+8: error return from DGGBAK (computing VL) =N+9: error return from DGGBAK (computing VR) =N+10: error return from DLASCL (various calls)

Further Details

Balancing

This driver calls DGGBAL to both permute and scale rows and columns of A and B. The permutations PL and PR are chosen so that PL*A*PR and PL*B*R will be upper triangular except for the diagonal blocks A(i:j,i:j) and B(i:j,i:j), with i and j as close together as possible. The diagonal scaling matrices DL and DR are chosen so that the pair DL*PL*A*PR*DR, DL*PL*B*PR*DR have elements close to one (except for the elements that start out zero.)

After the eigenvalues and eigenvectors of the balanced matrices have been computed, DGGBAK transforms the eigenvectors back to what they would have been (in perfect arithmetic) if they had not been balanced.

Contents of A and B on Exit


If any eigenvectors are computed (either JOBVL='V' or JOBVR='V' or both), then on exit the arrays A and B will contain the real Schur form[*] of the "balanced" versions of A and B. If no eigenvectors are computed, then only the diagonal blocks will be correct.

[*] See DHGEQZ, DGEGS, or read the book "Matrix Computations", by Golub & van Loan, pub. by Johns Hopkins U. Press.


.. Parameters ..

int psi::C_DGEHRD ( int  n,
int  ilo,
int  ihi,
double *  a,
int  lda,
double *  tau,
double *  work,
int  lwork 
)

Purpose

DGEHRD reduces a real general matrix A to upper Hessenberg form H by an orthogonal similarity transformation: Q' * A * Q = H .

Arguments

N (input) INTEGER The order of the matrix A. N >= 0.

ILO (input) INTEGER IHI (input) INTEGER It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to DGEBAL; otherwise they should be set to 1 and N respectively. See Further Details. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the N-by-N general matrix to be reduced. On exit, the upper triangle and the first subdiagonal of A are overwritten with the upper Hessenberg matrix H, and the elements below the first subdiagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors. See Further Details.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

TAU (output) DOUBLE PRECISION array, dimension (N-1) The scalar factors of the elementary reflectors (see Further Details). Elements 1:ILO-1 and IHI:N-1 of TAU are set to zero.

WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The length of the array WORK. LWORK >= max(1,N). For optimum performance LWORK >= N*NB, where NB is the optimal blocksize.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value.

Further Details

The matrix Q is represented as a product of (ihi-ilo) elementary reflectors

Q = H(ilo) H(ilo+1) . . . H(ihi-1).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(1:i) = 0, v(i+1) = 1 and v(ihi+1:n) = 0; v(i+2:ihi) is stored on exit in A(i+2:ihi,i), and tau in TAU(i).

The contents of A are illustrated by the following example, with n = 7, ilo = 2 and ihi = 6:

on entry, on exit,

( a a a a a a a ) ( a a h h h h a ) ( a a a a a a ) ( a h h h h a ) ( a a a a a a ) ( h h h h h h ) ( a a a a a a ) ( v2 h h h h h ) ( a a a a a a ) ( v2 v3 h h h h ) ( a a a a a a ) ( v2 v3 v4 h h h ) ( a ) ( a )

where a denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

This file is a slight modification of LAPACK-3.0's DGEHRD subroutine incorporating improvements proposed by Quintana-Orti and Van de Geijn (2006). (See DLAHR2.)


.. Parameters ..

int psi::C_DGELQF ( int  m,
int  n,
double *  a,
int  lda,
double *  tau,
double *  work,
int  lwork 
)

Purpose

DGELQF computes an LQ factorization of a real M-by-N matrix A: A = L * Q.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, the elements on and below the diagonal of the array contain the m-by-min(m,n) lower trapezoidal matrix L (L is lower triangular if m <= n); the elements above the diagonal, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors (see Further Details).

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details).

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,M). For optimum performance LWORK >= M*NB, where NB is the optimal blocksize.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value

Further Details

The matrix Q is represented as a product of elementary reflectors

Q = H(k) . . . H(2) H(1), where k = min(m,n).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i,i+1:n), and tau in TAU(i).


.. Local Scalars ..

int psi::C_DGELS ( char  trans,
int  m,
int  n,
int  nrhs,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  work,
int  lwork 
)

Purpose

DGELS solves overdetermined or underdetermined real linear systems involving an M-by-N matrix A, or its transpose, using a QR or LQ factorization of A. It is assumed that A has full rank.

The following options are provided:

  1. If TRANS = 'N' and m >= n: find the least squares solution of an overdetermined system, i.e., solve the least squares problem minimize || B - A*X ||.
  2. If TRANS = 'N' and m < n: find the minimum norm solution of an underdetermined system A * X = B.
  3. If TRANS = 'T' and m >= n: find the minimum norm solution of an undetermined system A**T * X = B.
  4. If TRANS = 'T' and m < n: find the least squares solution of an overdetermined system, i.e., solve the least squares problem minimize || B - A**T * X ||.

Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.

Arguments

TRANS (input) CHARACTER*1 = 'N': the linear system involves A; = 'T': the linear system involves A**T.

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >=0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, if M >= N, A is overwritten by details of its QR factorization as returned by DGEQRF; if M < N, A is overwritten by details of its LQ factorization as returned by DGELQF.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the matrix B of right hand side vectors, stored columnwise; B is M-by-NRHS if TRANS = 'N', or N-by-NRHS if TRANS = 'T'. On exit, if INFO = 0, B is overwritten by the solution vectors, stored columnwise: if TRANS = 'N' and m >= n, rows 1 to n of B contain the least squares solution vectors; the residual sum of squares for the solution in each column is given by the sum of squares of elements N+1 to M in that column; if TRANS = 'N' and m < n, rows 1 to N of B contain the minimum norm solution vectors; if TRANS = 'T' and m >= n, rows 1 to M of B contain the minimum norm solution vectors; if TRANS = 'T' and m < n, rows 1 to M of B contain the least squares solution vectors; the residual sum of squares for the solution in each column is given by the sum of squares of elements M+1 to N in that column.

LDB (input) INTEGER The leading dimension of the array B. LDB >= MAX(1,M,N).

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max( 1, MN + max( MN, NRHS ) ). For optimal performance, LWORK >= max( 1, MN + max( MN, NRHS )*NB ). where MN = min(M,N) and NB is the optimum block size.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, the i-th diagonal element of the triangular factor of A is zero, so that A does not have full rank; the least squares solution could not be computed.


.. Parameters ..

int psi::C_DGELSD ( int  m,
int  n,
int  nrhs,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  s,
double  rcond,
int *  rank,
double *  work,
int  lwork,
int *  iwork 
)

Purpose

DGELSD computes the minimum-norm solution to a real linear least squares problem: minimize 2-norm(| b - A*x |) using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient.

Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.

The problem is solved in three steps: (1) Reduce the coefficient matrix A to bidiagonal form with Householder transformations, reducing the original problem into a "bidiagonal least squares problem" (BLS) (2) Solve the BLS using a divide and conquer approach. (3) Apply back all the Householder tranformations to solve the original least squares problem.

The effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value.

The divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none.

Arguments

M (input) INTEGER The number of rows of A. M >= 0.

N (input) INTEGER The number of columns of A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.

A (input) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A has been destroyed.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the M-by-NRHS right hand side matrix B. On exit, B is overwritten by the N-by-NRHS solution matrix X. If m >= n and RANK = n, the residual sum-of-squares for the solution in the i-th column is given by the sum of squares of elements n+1:m in that column.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,max(M,N)).

S (output) DOUBLE PRECISION array, dimension (min(M,N)) The singular values of A in decreasing order. The condition number of A in the 2-norm = S(1)/S(min(m,n)).

RCOND (input) DOUBLE PRECISION RCOND is used to determine the effective rank of A. Singular values S(i) <= RCOND*S(1) are treated as zero. If RCOND < 0, machine precision is used instead.

RANK (output) INTEGER The effective rank of A, i.e., the number of singular values which are greater than RCOND*S(1).

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK must be at least 1. The exact minimum amount of workspace needed depends on M, N and NRHS. As long as LWORK is at least 12*N + 2*N*SMLSIZ + 8*N*NLVL + N*NRHS + (SMLSIZ+1)**2, if M is greater than or equal to N or 12*M + 2*M*SMLSIZ + 8*M*NLVL + M*NRHS + (SMLSIZ+1)**2, if M is less than N, the code will execute correctly. SMLSIZ is returned by ILAENV and is equal to the maximum size of the subproblems at the bottom of the computation tree (usually about 25), and NLVL = MAX( 0, INT( LOG_2( MIN( M,N )/(SMLSIZ+1) ) ) + 1 ) For good performance, LWORK should generally be larger.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

IWORK (workspace) INTEGER array, dimension (MAX(1,LIWORK)) LIWORK >= max(1, 3 * MINMN * NLVL + 11 * MINMN), where MINMN = MIN( M,N ). On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. > 0: the algorithm for computing the SVD failed to converge; if INFO = i, i off-diagonal elements of an intermediate bidiagonal form did not converge to zero.

Further Details

Based on contributions by Ming Gu and Ren-Cang Li, Computer Science Division, University of California at Berkeley, USA Osni Marques, LBNL/NERSC, USA


.. Parameters ..

int psi::C_DGELSS ( int  m,
int  n,
int  nrhs,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  s,
double  rcond,
int *  rank,
double *  work,
int  lwork 
)

Purpose

DGELSS computes the minimum norm solution to a real linear least squares problem:

Minimize 2-norm(| b - A*x |).

using the singular value decomposition (SVD) of A. A is an M-by-N matrix which may be rank-deficient.

Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.

The effective rank of A is determined by treating as zero those singular values which are less than RCOND times the largest singular value.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, the first min(m,n) rows of A are overwritten with its right singular vectors, stored rowwise.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the M-by-NRHS right hand side matrix B. On exit, B is overwritten by the N-by-NRHS solution matrix X. If m >= n and RANK = n, the residual sum-of-squares for the solution in the i-th column is given by the sum of squares of elements n+1:m in that column.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,max(M,N)).

S (output) DOUBLE PRECISION array, dimension (min(M,N)) The singular values of A in decreasing order. The condition number of A in the 2-norm = S(1)/S(min(m,n)).

RCOND (input) DOUBLE PRECISION RCOND is used to determine the effective rank of A. Singular values S(i) <= RCOND*S(1) are treated as zero. If RCOND < 0, machine precision is used instead.

RANK (output) INTEGER The effective rank of A, i.e., the number of singular values which are greater than RCOND*S(1).

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= 1, and also: LWORK >= 3*min(M,N) + max( 2*min(M,N), max(M,N), NRHS ) For good performance, LWORK should generally be larger.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. > 0: the algorithm for computing the SVD failed to converge; if INFO = i, i off-diagonal elements of an intermediate bidiagonal form did not converge to zero.


.. Parameters ..

int psi::C_DGELSX ( int  m,
int  n,
int  nrhs,
double *  a,
int  lda,
double *  b,
int  ldb,
int *  jpvt,
double  rcond,
int *  rank,
double *  work 
)

Purpose

This routine is deprecated and has been replaced by routine DGELSY.

DGELSX computes the minimum-norm solution to a real linear least squares problem: minimize || A * X - B || using a complete orthogonal factorization of A. A is an M-by-N matrix which may be rank-deficient.

Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.

The routine first computes a QR factorization with column pivoting: A * P = Q * [ R11 R12 ] [ 0 R22 ] with R11 defined as the largest leading submatrix whose estimated condition number is less than 1/RCOND. The order of R11, RANK, is the effective rank of A.

Then, R22 is considered to be negligible, and R12 is annihilated by orthogonal transformations from the right, arriving at the complete orthogonal factorization: A * P = Q * [ T11 0 ] * Z [ 0 0 ] The minimum-norm solution is then X = P * Z' [ inv(T11)*Q1'*B ] [ 0 ] where Q1 consists of the first RANK columns of Q.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of matrices B and X. NRHS >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A has been overwritten by details of its complete orthogonal factorization.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the M-by-NRHS right hand side matrix B. On exit, the N-by-NRHS solution matrix X. If m >= n and RANK = n, the residual sum-of-squares for the solution in the i-th column is given by the sum of squares of elements N+1:M in that column.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,M,N).

JPVT (input/output) INTEGER array, dimension (N) On entry, if JPVT(i) .ne. 0, the i-th column of A is an initial column, otherwise it is a free column. Before the QR factorization of A, all initial columns are permuted to the leading positions; only the remaining free columns are moved as a result of column pivoting during the factorization. On exit, if JPVT(i) = k, then the i-th column of A*P was the k-th column of A.

RCOND (input) DOUBLE PRECISION RCOND is used to determine the effective rank of A, which is defined as the order of the largest leading triangular submatrix R11 in the QR factorization with pivoting of A, whose estimated condition number < 1/RCOND.

RANK (output) INTEGER The effective rank of A, i.e., the order of the submatrix R11. This is the same as the order of the submatrix T11 in the complete orthogonal factorization of A.

WORK (workspace) DOUBLE PRECISION array, dimension (max( min(M,N)+3*N, 2*min(M,N)+NRHS )),

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value


.. Parameters ..

int psi::C_DGELSY ( int  m,
int  n,
int  nrhs,
double *  a,
int  lda,
double *  b,
int  ldb,
int *  jpvt,
double  rcond,
int *  rank,
double *  work,
int  lwork 
)

Purpose

DGELSY computes the minimum-norm solution to a real linear least squares problem: minimize || A * X - B || using a complete orthogonal factorization of A. A is an M-by-N matrix which may be rank-deficient.

Several right hand side vectors b and solution vectors x can be handled in a single call; they are stored as the columns of the M-by-NRHS right hand side matrix B and the N-by-NRHS solution matrix X.

The routine first computes a QR factorization with column pivoting: A * P = Q * [ R11 R12 ] [ 0 R22 ] with R11 defined as the largest leading submatrix whose estimated condition number is less than 1/RCOND. The order of R11, RANK, is the effective rank of A.

Then, R22 is considered to be negligible, and R12 is annihilated by orthogonal transformations from the right, arriving at the complete orthogonal factorization: A * P = Q * [ T11 0 ] * Z [ 0 0 ] The minimum-norm solution is then X = P * Z' [ inv(T11)*Q1'*B ] [ 0 ] where Q1 consists of the first RANK columns of Q.

This routine is basically identical to the original xGELSX except three differences: o The call to the subroutine xGEQPF has been substituted by the the call to the subroutine xGEQP3. This subroutine is a Blas-3 version of the QR factorization with column pivoting. o Matrix B (the right hand side) is updated with Blas-3. o The permutation of matrix B (the right hand side) is faster and more simple.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of matrices B and X. NRHS >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A has been overwritten by details of its complete orthogonal factorization.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the M-by-NRHS right hand side matrix B. On exit, the N-by-NRHS solution matrix X.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,M,N).

JPVT (input/output) INTEGER array, dimension (N) On entry, if JPVT(i) .ne. 0, the i-th column of A is permuted to the front of AP, otherwise column i is a free column. On exit, if JPVT(i) = k, then the i-th column of AP was the k-th column of A.

RCOND (input) DOUBLE PRECISION RCOND is used to determine the effective rank of A, which is defined as the order of the largest leading triangular submatrix R11 in the QR factorization with pivoting of A, whose estimated condition number < 1/RCOND.

RANK (output) INTEGER The effective rank of A, i.e., the order of the submatrix R11. This is the same as the order of the submatrix T11 in the complete orthogonal factorization of A.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. The unblocked strategy requires that: LWORK >= MAX( MN+3*N+1, 2*MN+NRHS ), where MN = min( M, N ). The block algorithm requires that: LWORK >= MAX( MN+2*N+NB*(N+1), 2*MN+NB*NRHS ), where NB is an upper bound on the blocksize returned by ILAENV for the routines DGEQP3, DTZRZF, STZRQF, DORMQR, and DORMRZ.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: If INFO = -i, the i-th argument had an illegal value.

Further Details

Based on contributions by A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA E. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain G. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain


.. Parameters ..

void psi::C_DGEMM ( char  transa,
char  transb,
int  m,
int  n,
int  k,
double  alpha,
double *  a,
int  lda,
double *  b,
int  ldb,
double  beta,
double *  c,
int  ldc 
)

Purpose

DGEMM performs one of the matrix-matrix operations

C := alpha*op( A )*op( B ) + beta*C,

where op( X ) is one of

op( X ) = X or op( X ) = X',

alpha and beta are scalars, and A, B and C are matrices, with op( A ) an m by k matrix, op( B ) a k by n matrix and C an m by n matrix.

Arguments

TRANSA - CHARACTER*1. On entry, TRANSA specifies the form of op( A ) to be used in the matrix multiplication as follows:

TRANSA = 'N' or 'n', op( A ) = A.

TRANSA = 'T' or 't', op( A ) = A'.

TRANSA = 'C' or 'c', op( A ) = A'.

Unchanged on exit.

TRANSB - CHARACTER*1. On entry, TRANSB specifies the form of op( B ) to be used in the matrix multiplication as follows:

TRANSB = 'N' or 'n', op( B ) = B.

TRANSB = 'T' or 't', op( B ) = B'.

TRANSB = 'C' or 'c', op( B ) = B'.

Unchanged on exit.

M - INTEGER. On entry, M specifies the number of rows of the matrix op( A ) and of the matrix C. M must be at least zero. Unchanged on exit.

N - INTEGER. On entry, N specifies the number of columns of the matrix op( B ) and the number of columns of the matrix C. N must be at least zero. Unchanged on exit.

K - INTEGER. On entry, K specifies the number of columns of the matrix op( A ) and the number of rows of the matrix op( B ). K must be at least zero. Unchanged on exit.

ALPHA - DOUBLE PRECISION. On entry, ALPHA specifies the scalar alpha. Unchanged on exit.

A - DOUBLE PRECISION array of DIMENSION ( LDA, ka ), where ka is k when TRANSA = 'N' or 'n', and is m otherwise. Before entry with TRANSA = 'N' or 'n', the leading m by k part of the array A must contain the matrix A, otherwise the leading k by m part of the array A must contain the matrix A. Unchanged on exit.

LDA - INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. When TRANSA = 'N' or 'n' then LDA must be at least max( 1, m ), otherwise LDA must be at least max( 1, k ). Unchanged on exit.

B - DOUBLE PRECISION array of DIMENSION ( LDB, kb ), where kb is n when TRANSB = 'N' or 'n', and is k otherwise. Before entry with TRANSB = 'N' or 'n', the leading k by n part of the array B must contain the matrix B, otherwise the leading n by k part of the array B must contain the matrix B. Unchanged on exit.

LDB - INTEGER. On entry, LDB specifies the first dimension of B as declared in the calling (sub) program. When TRANSB = 'N' or 'n' then LDB must be at least max( 1, k ), otherwise LDB must be at least max( 1, n ). Unchanged on exit.

BETA - DOUBLE PRECISION. On entry, BETA specifies the scalar beta. When BETA is supplied as zero then C need not be set on input. Unchanged on exit.

C - DOUBLE PRECISION array of DIMENSION ( LDC, n ). Before entry, the leading m by n part of the array C must contain the matrix C, except when beta is zero, in which case C need not be set on entry. On exit, the array C is overwritten by the m by n matrix ( alpha*op( A )*op( B ) + beta*C ).

LDC - INTEGER. On entry, LDC specifies the first dimension of C as declared in the calling (sub) program. LDC must be at least max( 1, m ). Unchanged on exit.

Level 3 Blas routine.

– Written on 8-February-1989. Jack Dongarra, Argonne National Laboratory. Iain Duff, AERE Harwell. Jeremy Du Croz, Numerical Algorithms Group Ltd. Sven Hammarling, Numerical Algorithms Group Ltd.

.. External Functions ..

void psi::C_DGEMV ( char  trans,
int  m,
int  n,
double  alpha,
double *  a,
int  lda,
double *  x,
int  incx,
double  beta,
double *  y,
int  incy 
)

Purpose

DGEMV performs one of the matrix-vector operations

y := alpha*A*x + beta*y, or y := alpha*A'*x + beta*y,

where alpha and beta are scalars, x and y are vectors and A is an m by n matrix.

Arguments

TRANS - CHARACTER*1. On entry, TRANS specifies the operation to be performed as follows:

TRANS = 'N' or 'n' y := alpha*A*x + beta*y.

TRANS = 'T' or 't' y := alpha*A'*x + beta*y.

TRANS = 'C' or 'c' y := alpha*A'*x + beta*y.

Unchanged on exit.

M - INTEGER. On entry, M specifies the number of rows of the matrix A. M must be at least zero. Unchanged on exit.

N - INTEGER. On entry, N specifies the number of columns of the matrix A. N must be at least zero. Unchanged on exit.

ALPHA - DOUBLE PRECISION. On entry, ALPHA specifies the scalar alpha. Unchanged on exit.

A - DOUBLE PRECISION array of DIMENSION ( LDA, n ). Before entry, the leading m by n part of the array A must contain the matrix of coefficients. Unchanged on exit.

LDA - INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. LDA must be at least max( 1, m ). Unchanged on exit.

X - DOUBLE PRECISION array of DIMENSION at least ( 1 + ( n - 1 )*abs( INCX ) ) when TRANS = 'N' or 'n' and at least ( 1 + ( m - 1 )*abs( INCX ) ) otherwise. Before entry, the incremented array X must contain the vector x. Unchanged on exit.

INCX - INTEGER. On entry, INCX specifies the increment for the elements of X. INCX must not be zero. Unchanged on exit.

BETA - DOUBLE PRECISION. On entry, BETA specifies the scalar beta. When BETA is supplied as zero then Y need not be set on input. Unchanged on exit.

Y - DOUBLE PRECISION array of DIMENSION at least ( 1 + ( m - 1 )*abs( INCY ) ) when TRANS = 'N' or 'n' and at least ( 1 + ( n - 1 )*abs( INCY ) ) otherwise. Before entry with BETA non-zero, the incremented array Y must contain the vector y. On exit, Y is overwritten by the updated vector y.

INCY - INTEGER. On entry, INCY specifies the increment for the elements of Y. INCY must not be zero. Unchanged on exit.

Level 2 Blas routine.

– Written on 22-October-1986. Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office. Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs.

.. Parameters ..

int psi::C_DGEQLF ( int  m,
int  n,
double *  a,
int  lda,
double *  tau,
double *  work,
int  lwork 
)

Purpose

DGEQLF computes a QL factorization of a real M-by-N matrix A: A = Q * L.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, if m >= n, the lower triangle of the subarray A(m-n+1:m,1:n) contains the N-by-N lower triangular matrix L; if m <= n, the elements on and below the (n-m)-th superdiagonal contain the M-by-N lower trapezoidal matrix L; the remaining elements, with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors (see Further Details).

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details).

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,N). For optimum performance LWORK >= N*NB, where NB is the optimal blocksize.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value

Further Details

The matrix Q is represented as a product of elementary reflectors

Q = H(k) . . . H(2) H(1), where k = min(m,n).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(m-k+i+1:m) = 0 and v(m-k+i) = 1; v(1:m-k+i-1) is stored on exit in A(1:m-k+i-1,n-k+i), and tau in TAU(i).


.. Local Scalars ..

int psi::C_DGEQP3 ( int  m,
int  n,
double *  a,
int  lda,
int *  jpvt,
double *  tau,
double *  work,
int  lwork 
)

Purpose

DGEQP3 computes a QR factorization with column pivoting of a matrix A: A*P = Q*R using Level 3 BLAS.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, the upper triangle of the array contains the min(M,N)-by-N upper trapezoidal matrix R; the elements below the diagonal, together with the array TAU, represent the orthogonal matrix Q as a product of min(M,N) elementary reflectors.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

JPVT (input/output) INTEGER array, dimension (N) On entry, if JPVT(J).ne.0, the J-th column of A is permuted to the front of A*P (a leading column); if JPVT(J)=0, the J-th column of A is a free column. On exit, if JPVT(J)=K, then the J-th column of A*P was the the K-th column of A.

TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO=0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= 3*N+1. For optimal performance LWORK >= 2*N+( N+1 )*NB, where NB is the optimal blocksize.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value.

Further Details

The matrix Q is represented as a product of elementary reflectors

Q = H(1) H(2) . . . H(k), where k = min(m,n).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real/complex scalar, and v is a real/complex vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), and tau in TAU(i).

Based on contributions by G. Quintana-Orti, Depto. de Informatica, Universidad Jaime I, Spain X. Sun, Computer Science Dept., Duke University, USA


.. Parameters ..

int psi::C_DGEQPF ( int  m,
int  n,
double *  a,
int  lda,
int *  jpvt,
double *  tau,
double *  work 
)

Purpose

This routine is deprecated and has been replaced by routine DGEQP3.

DGEQPF computes a QR factorization with column pivoting of a real M-by-N matrix A: A*P = Q*R.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, the upper triangle of the array contains the min(M,N)-by-N upper triangular matrix R; the elements below the diagonal, together with the array TAU, represent the orthogonal matrix Q as a product of min(m,n) elementary reflectors.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

JPVT (input/output) INTEGER array, dimension (N) On entry, if JPVT(i) .ne. 0, the i-th column of A is permuted to the front of A*P (a leading column); if JPVT(i) = 0, the i-th column of A is a free column. On exit, if JPVT(i) = k, then the i-th column of A*P was the k-th column of A.

TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors.

WORK (workspace) DOUBLE PRECISION array, dimension (3*N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value

Further Details

The matrix Q is represented as a product of elementary reflectors

Q = H(1) H(2) . . . H(n)

Each H(i) has the form

H = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i).

The matrix P is represented in jpvt as follows: If jpvt(j) = i then the jth column of P is the ith canonical unit vector.

Partial column norm updating strategy modified by Z. Drmac and Z. Bujanovic, Dept. of Mathematics, University of Zagreb, Croatia. June 2010 For more details see LAPACK Working Note 176.


.. Parameters ..

int psi::C_DGEQRF ( int  m,
int  n,
double *  a,
int  lda,
double *  tau,
double *  work,
int  lwork 
)

Purpose

DGEQRF computes a QR factorization of a real M-by-N matrix A: A = Q * R.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, the elements on and above the diagonal of the array contain the min(M,N)-by-N upper trapezoidal matrix R (R is upper triangular if m >= n); the elements below the diagonal, with the array TAU, represent the orthogonal matrix Q as a product of min(m,n) elementary reflectors (see Further Details).

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details).

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,N). For optimum performance LWORK >= N*NB, where NB is the optimal blocksize.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value

Further Details

The matrix Q is represented as a product of elementary reflectors

Q = H(1) H(2) . . . H(k), where k = min(m,n).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:m) is stored on exit in A(i+1:m,i), and tau in TAU(i).


.. Local Scalars ..

void psi::C_DGER ( int  m,
int  n,
double  alpha,
double *  x,
int  incx,
double *  y,
int  incy,
double *  a,
int  lda 
)

Purpose

DGER performs the rank 1 operation

A := alpha*x*y' + A,

where alpha is a scalar, x is an m element vector, y is an n element vector and A is an m by n matrix.

Arguments

M - INTEGER. On entry, M specifies the number of rows of the matrix A. M must be at least zero. Unchanged on exit.

N - INTEGER. On entry, N specifies the number of columns of the matrix A. N must be at least zero. Unchanged on exit.

ALPHA - DOUBLE PRECISION. On entry, ALPHA specifies the scalar alpha. Unchanged on exit.

X - DOUBLE PRECISION array of dimension at least ( 1 + ( m - 1 )*abs( INCX ) ). Before entry, the incremented array X must contain the m element vector x. Unchanged on exit.

INCX - INTEGER. On entry, INCX specifies the increment for the elements of X. INCX must not be zero. Unchanged on exit.

Y - DOUBLE PRECISION array of dimension at least ( 1 + ( n - 1 )*abs( INCY ) ). Before entry, the incremented array Y must contain the n element vector y. Unchanged on exit.

INCY - INTEGER. On entry, INCY specifies the increment for the elements of Y. INCY must not be zero. Unchanged on exit.

A - DOUBLE PRECISION array of DIMENSION ( LDA, n ). Before entry, the leading m by n part of the array A must contain the matrix of coefficients. On exit, A is overwritten by the updated matrix.

LDA - INTEGER. On entry, LDA specifies the first dimension of A as declared in the calling (sub) program. LDA must be at least max( 1, m ). Unchanged on exit.

Level 2 Blas routine.

– Written on 22-October-1986. Jack Dongarra, Argonne National Lab. Jeremy Du Croz, Nag Central Office. Sven Hammarling, Nag Central Office. Richard Hanson, Sandia National Labs.

.. Parameters ..

int psi::C_DGERFS ( char  trans,
int  n,
int  nrhs,
double *  a,
int  lda,
double *  af,
int  ldaf,
int *  ipiv,
double *  b,
int  ldb,
double *  x,
int  ldx,
double *  ferr,
double *  berr,
double *  work,
int *  iwork 
)

Purpose

DGERFS improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution.

Arguments

TRANS (input) CHARACTER*1 Specifies the form of the system of equations: = 'N': A * X = B (No transpose) = 'T': A**T * X = B (Transpose) = 'C': A**H * X = B (Conjugate transpose = Transpose)

N (input) INTEGER The order of the matrix A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.

A (input) DOUBLE PRECISION array, dimension (LDA,N) The original N-by-N matrix A.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

AF (input) DOUBLE PRECISION array, dimension (LDAF,N) The factors L and U from the factorization A = P*L*U as computed by DGETRF.

LDAF (input) INTEGER The leading dimension of the array AF. LDAF >= max(1,N).

IPIV (input) INTEGER array, dimension (N) The pivot indices from DGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).

B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) The right hand side matrix B.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

X (input/output) DOUBLE PRECISION array, dimension (LDX,NRHS) On entry, the solution matrix X, as computed by DGETRS. On exit, the improved solution matrix X.

LDX (input) INTEGER The leading dimension of the array X. LDX >= max(1,N).

FERR (output) DOUBLE PRECISION array, dimension (NRHS) The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error.

BERR (output) DOUBLE PRECISION array, dimension (NRHS) The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

WORK (workspace) DOUBLE PRECISION array, dimension (3*N)

IWORK (workspace) INTEGER array, dimension (N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value

Internal Parameters

ITMAX is the maximum number of steps of iterative refinement.


.. Parameters ..

int psi::C_DGERQF ( int  m,
int  n,
double *  a,
int  lda,
double *  tau,
double *  work,
int  lwork 
)

Purpose

DGERQF computes an RQ factorization of a real M-by-N matrix A: A = R * Q.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, if m <= n, the upper triangle of the subarray A(1:m,n-m+1:n) contains the M-by-M upper triangular matrix R; if m >= n, the elements on and above the (m-n)-th subdiagonal contain the M-by-N upper trapezoidal matrix R; the remaining elements, with the array TAU, represent the orthogonal matrix Q as a product of min(m,n) elementary reflectors (see Further Details).

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

TAU (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors (see Further Details).

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,M). For optimum performance LWORK >= M*NB, where NB is the optimal blocksize.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value

Further Details

The matrix Q is represented as a product of elementary reflectors

Q = H(1) H(2) . . . H(k), where k = min(m,n).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(n-k+i+1:n) = 0 and v(n-k+i) = 1; v(1:n-k+i-1) is stored on exit in A(m-k+i,1:n-k+i-1), and tau in TAU(i).


.. Local Scalars ..

int psi::C_DGESDD ( char  jobz,
int  m,
int  n,
double *  a,
int  lda,
double *  s,
double *  u,
int  ldu,
double *  vt,
int  ldvt,
double *  work,
int  lwork,
int *  iwork 
)

Purpose

DGESDD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and right singular vectors. If singular vectors are desired, it uses a divide-and-conquer algorithm.

The SVD is written

 A = U * SIGMA * transpose(V)

where SIGMA is an M-by-N matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA are the singular values of A; they are real and non-negative, and are returned in descending order. The first min(m,n) columns of U and V are the left and right singular vectors of A.

Note that the routine returns VT = V**T, not V.

The divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none.

Arguments

JOBZ (input) CHARACTER*1 Specifies options for computing all or part of the matrix U: = 'A': all M columns of U and all N rows of V**T are returned in the arrays U and VT; = 'S': the first min(M,N) columns of U and the first min(M,N) rows of V**T are returned in the arrays U and VT; = 'O': If M >= N, the first N columns of U are overwritten on the array A and all rows of V**T are returned in the array VT; otherwise, all columns of U are returned in the array U and the first M rows of V**T are overwritten in the array A; = 'N': no columns of U or rows of V**T are computed.

M (input) INTEGER The number of rows of the input matrix A. M >= 0.

N (input) INTEGER The number of columns of the input matrix A. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, if JOBZ = 'O', A is overwritten with the first N columns of U (the left singular vectors, stored columnwise) if M >= N; A is overwritten with the first M rows of V**T (the right singular vectors, stored rowwise) otherwise. if JOBZ .ne. 'O', the contents of A are destroyed.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

S (output) DOUBLE PRECISION array, dimension (min(M,N)) The singular values of A, sorted so that S(i) >= S(i+1).

U (output) DOUBLE PRECISION array, dimension (LDU,UCOL) UCOL = M if JOBZ = 'A' or JOBZ = 'O' and M < N; UCOL = min(M,N) if JOBZ = 'S'. If JOBZ = 'A' or JOBZ = 'O' and M < N, U contains the M-by-M orthogonal matrix U; if JOBZ = 'S', U contains the first min(M,N) columns of U (the left singular vectors, stored columnwise); if JOBZ = 'O' and M >= N, or JOBZ = 'N', U is not referenced.

LDU (input) INTEGER The leading dimension of the array U. LDU >= 1; if JOBZ = 'S' or 'A' or JOBZ = 'O' and M < N, LDU >= M.

VT (output) DOUBLE PRECISION array, dimension (LDVT,N) If JOBZ = 'A' or JOBZ = 'O' and M >= N, VT contains the N-by-N orthogonal matrix V**T; if JOBZ = 'S', VT contains the first min(M,N) rows of V**T (the right singular vectors, stored rowwise); if JOBZ = 'O' and M < N, or JOBZ = 'N', VT is not referenced.

LDVT (input) INTEGER The leading dimension of the array VT. LDVT >= 1; if JOBZ = 'A' or JOBZ = 'O' and M >= N, LDVT >= N; if JOBZ = 'S', LDVT >= min(M,N).

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK;

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= 1. If JOBZ = 'N', LWORK >= 3*min(M,N) + max(max(M,N),7*min(M,N)). If JOBZ = 'O', LWORK >= 3*min(M,N) + max(max(M,N),5*min(M,N)*min(M,N)+4*min(M,N)). If JOBZ = 'S' or 'A' LWORK >= 3*min(M,N) + max(max(M,N),4*min(M,N)*min(M,N)+4*min(M,N)). For good performance, LWORK should generally be larger. If LWORK = -1 but other input arguments are legal, WORK(1) returns the optimal LWORK.

IWORK (workspace) INTEGER array, dimension (8*min(M,N))

C++ Return value: INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value. > 0: DBDSDC did not converge, updating process failed.

Further Details

Based on contributions by Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA


.. Parameters ..

int psi::C_DGESVX ( char  fact,
char  trans,
int  n,
int  nrhs,
double *  a,
int  lda,
double *  af,
int  ldaf,
int *  ipiv,
char  equed,
double *  r,
double *  c,
double *  b,
int  ldb,
double *  x,
int  ldx,
double *  rcond,
double *  ferr,
double *  berr,
double *  work,
int *  iwork 
)

Purpose

DGESVX uses the LU factorization to compute the solution to a real system of linear equations A * X = B, where A is an N-by-N matrix and X and B are N-by-NRHS matrices.

Error bounds on the solution and a condition estimate are also provided.

Description

The following steps are performed:

  1. If FACT = 'E', real scaling factors are computed to equilibrate the system: TRANS = 'N': diag(R)*A*diag(C) *inv(diag(C))*X = diag(R)*B TRANS = 'T': (diag(R)*A*diag(C))**T *inv(diag(R))*X = diag(C)*B TRANS = 'C': (diag(R)*A*diag(C))**H *inv(diag(R))*X = diag(C)*B Whether or not the system will be equilibrated depends on the scaling of the matrix A, but if equilibration is used, A is overwritten by diag(R)*A*diag(C) and B by diag(R)*B (if TRANS='N') or diag(C)*B (if TRANS = 'T' or 'C').
  2. If FACT = 'N' or 'E', the LU decomposition is used to factor the matrix A (after equilibration if FACT = 'E') as A = P * L * U, where P is a permutation matrix, L is a unit lower triangular matrix, and U is upper triangular.
  3. If some U(i,i)=0, so that U is exactly singular, then the routine returns with INFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, C++ Return value: INFO (output) INTEGER to solve for X and compute error bounds as described below.
  4. The system of equations is solved for X using the factored form of A.
  5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
  6. If equilibration was used, the matrix X is premultiplied by diag(C) (if TRANS = 'N') or diag(R) (if TRANS = 'T' or 'C') so that it solves the original system before equilibration.

Arguments

FACT (input) CHARACTER*1 Specifies whether or not the factored form of the matrix A is supplied on entry, and if not, whether the matrix A should be equilibrated before it is factored. = 'F': On entry, AF and IPIV contain the factored form of A. If EQUED is not 'N', the matrix A has been equilibrated with scaling factors given by R and C. A, AF, and IPIV are not modified. = 'N': The matrix A will be copied to AF and factored. = 'E': The matrix A will be equilibrated if necessary, then copied to AF and factored.

TRANS (input) CHARACTER*1 Specifies the form of the system of equations: = 'N': A * X = B (No transpose) = 'T': A**T * X = B (Transpose) = 'C': A**H * X = B (Transpose)

N (input) INTEGER The number of linear equations, i.e., the order of the matrix A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the N-by-N matrix A. If FACT = 'F' and EQUED is not 'N', then A must have been equilibrated by the scaling factors in R and/or C. A is not modified if FACT = 'F' or 'N', or if FACT = 'E' and EQUED = 'N' on exit.

On exit, if EQUED .ne. 'N', A is scaled as follows: EQUED = 'R': A := diag(R) * A EQUED = 'C': A := A * diag(C) EQUED = 'B': A := diag(R) * A * diag(C).

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

AF (input or output) DOUBLE PRECISION array, dimension (LDAF,N) If FACT = 'F', then AF is an input argument and on entry contains the factors L and U from the factorization A = P*L*U as computed by DGETRF. If EQUED .ne. 'N', then AF is the factored form of the equilibrated matrix A.

If FACT = 'N', then AF is an output argument and on exit returns the factors L and U from the factorization A = P*L*U of the original matrix A.

If FACT = 'E', then AF is an output argument and on exit returns the factors L and U from the factorization A = P*L*U of the equilibrated matrix A (see the description of A for the form of the equilibrated matrix).

LDAF (input) INTEGER The leading dimension of the array AF. LDAF >= max(1,N).

IPIV (input or output) INTEGER array, dimension (N) If FACT = 'F', then IPIV is an input argument and on entry contains the pivot indices from the factorization A = P*L*U as computed by DGETRF; row i of the matrix was interchanged with row IPIV(i).

If FACT = 'N', then IPIV is an output argument and on exit contains the pivot indices from the factorization A = P*L*U of the original matrix A.

If FACT = 'E', then IPIV is an output argument and on exit contains the pivot indices from the factorization A = P*L*U of the equilibrated matrix A.

EQUED (input or output) CHARACTER*1 Specifies the form of equilibration that was done. = 'N': No equilibration (always true if FACT = 'N'). = 'R': Row equilibration, i.e., A has been premultiplied by diag(R). = 'C': Column equilibration, i.e., A has been postmultiplied by diag(C). = 'B': Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C). EQUED is an input argument if FACT = 'F'; otherwise, it is an output argument.

R (input or output) DOUBLE PRECISION array, dimension (N) The row scale factors for A. If EQUED = 'R' or 'B', A is multiplied on the left by diag(R); if EQUED = 'N' or 'C', R is not accessed. R is an input argument if FACT = 'F'; otherwise, R is an output argument. If FACT = 'F' and EQUED = 'R' or 'B', each element of R must be positive.

C (input or output) DOUBLE PRECISION array, dimension (N) The column scale factors for A. If EQUED = 'C' or 'B', A is multiplied on the right by diag(C); if EQUED = 'N' or 'R', C is not accessed. C is an input argument if FACT = 'F'; otherwise, C is an output argument. If FACT = 'F' and EQUED = 'C' or 'B', each element of C must be positive.

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the N-by-NRHS right hand side matrix B. On exit, if EQUED = 'N', B is not modified; if TRANS = 'N' and EQUED = 'R' or 'B', B is overwritten by diag(R)*B; if TRANS = 'T' or 'C' and EQUED = 'C' or 'B', B is overwritten by diag(C)*B.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

X (output) DOUBLE PRECISION array, dimension (LDX,NRHS) If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X to the original system of equations. Note that A and B are modified on exit if EQUED .ne. 'N', and the solution to the equilibrated system is inv(diag(C))*X if TRANS = 'N' and EQUED = 'C' or 'B', or inv(diag(R))*X if TRANS = 'T' or 'C' and EQUED = 'R' or 'B'.

LDX (input) INTEGER The leading dimension of the array X. LDX >= max(1,N).

RCOND (output) DOUBLE PRECISION The estimate of the reciprocal condition number of the matrix A after equilibration (if done). If RCOND is less than the machine precision (in particular, if RCOND = 0), the matrix is singular to working precision. This condition is indicated by a return code of INFO > 0.

FERR (output) DOUBLE PRECISION array, dimension (NRHS) The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error.

BERR (output) DOUBLE PRECISION array, dimension (NRHS) The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

WORK (workspace/output) DOUBLE PRECISION array, dimension (4*N) On exit, WORK(1) contains the reciprocal pivot growth factor norm(A)/norm(U). The "max absolute element" norm is used. If WORK(1) is much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor. This also means that the solution X, condition estimator RCOND, and forward error bound FERR could be unreliable. If factorization fails with 0<INFO<=N, then WORK(1) contains the reciprocal pivot growth factor for the leading INFO columns of A.

IWORK (workspace) INTEGER array, dimension (N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, and i is <= N: U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed. RCOND = 0 is returned. = N+1: U is nonsingular, but RCOND is less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value of RCOND would suggest.


.. Parameters ..

int psi::C_DGETRS ( char  trans,
int  n,
int  nrhs,
double *  a,
int  lda,
int *  ipiv,
double *  b,
int  ldb 
)

Purpose

DGETRS solves a system of linear equations A * X = B or A' * X = B with a general N-by-N matrix A using the LU factorization computed by DGETRF.

Arguments

TRANS (input) CHARACTER*1 Specifies the form of the system of equations: = 'N': A * X = B (No transpose) = 'T': A'* X = B (Transpose) = 'C': A'* X = B (Conjugate transpose = Transpose)

N (input) INTEGER The order of the matrix A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

A (input) DOUBLE PRECISION array, dimension (LDA,N) The factors L and U from the factorization A = P*L*U as computed by DGETRF.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

IPIV (input) INTEGER array, dimension (N) The pivot indices from DGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the right hand side matrix B. On exit, the solution matrix X.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value


.. Parameters ..

int psi::C_DGGBAK ( char  job,
char  side,
int  n,
int  ilo,
int  ihi,
double *  lscale,
double *  rscale,
int  m,
double *  v,
int  ldv 
)

Purpose

DGGBAK forms the right or left eigenvectors of a real generalized eigenvalue problem A*x = lambda*B*x, by backward transformation on the computed eigenvectors of the balanced pair of matrices output by DGGBAL.

Arguments

JOB (input) CHARACTER*1 Specifies the type of backward transformation required: = 'N': do nothing, return immediately; = 'P': do backward transformation for permutation only; = 'S': do backward transformation for scaling only; = 'B': do backward transformations for both permutation and scaling. JOB must be the same as the argument JOB supplied to DGGBAL.

SIDE (input) CHARACTER*1 = 'R': V contains right eigenvectors; = 'L': V contains left eigenvectors.

N (input) INTEGER The number of rows of the matrix V. N >= 0.

ILO (input) INTEGER IHI (input) INTEGER The integers ILO and IHI determined by DGGBAL. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.

LSCALE (input) DOUBLE PRECISION array, dimension (N) Details of the permutations and/or scaling factors applied to the left side of A and B, as returned by DGGBAL.

RSCALE (input) DOUBLE PRECISION array, dimension (N) Details of the permutations and/or scaling factors applied to the right side of A and B, as returned by DGGBAL.

M (input) INTEGER The number of columns of the matrix V. M >= 0.

V (input/output) DOUBLE PRECISION array, dimension (LDV,M) On entry, the matrix of right or left eigenvectors to be transformed, as returned by DTGEVC. On exit, V is overwritten by the transformed eigenvectors.

LDV (input) INTEGER The leading dimension of the matrix V. LDV >= max(1,N).

C++ Return value: INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value.

Further Details

See R.C. Ward, Balancing the generalized eigenvalue problem, SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.


.. Local Scalars ..

int psi::C_DGGBAL ( char  job,
int  n,
double *  a,
int  lda,
double *  b,
int  ldb,
int *  ilo,
int *  ihi,
double *  lscale,
double *  rscale,
double *  work 
)

Purpose

DGGBAL balances a pair of general real matrices (A,B). This involves, first, permuting A and B by similarity transformations to isolate eigenvalues in the first 1 to ILO$-$1 and last IHI+1 to N elements on the diagonal; and second, applying a diagonal similarity transformation to rows and columns ILO to IHI to make the rows and columns as close in norm as possible. Both steps are optional.

Balancing may reduce the 1-norm of the matrices, and improve the accuracy of the computed eigenvalues and/or eigenvectors in the generalized eigenvalue problem A*x = lambda*B*x.

Arguments

JOB (input) CHARACTER*1 Specifies the operations to be performed on A and B: = 'N': none: simply set ILO = 1, IHI = N, LSCALE(I) = 1.0 and RSCALE(I) = 1.0 for i = 1,...,N. = 'P': permute only; = 'S': scale only; = 'B': both permute and scale.

N (input) INTEGER The order of the matrices A and B. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the input matrix A. On exit, A is overwritten by the balanced matrix. If JOB = 'N', A is not referenced.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

B (input/output) DOUBLE PRECISION array, dimension (LDB,N) On entry, the input matrix B. On exit, B is overwritten by the balanced matrix. If JOB = 'N', B is not referenced.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

ILO (output) INTEGER IHI (output) INTEGER ILO and IHI are set to integers such that on exit A(i,j) = 0 and B(i,j) = 0 if i > j and j = 1,...,ILO-1 or i = IHI+1,...,N. If JOB = 'N' or 'S', ILO = 1 and IHI = N.

LSCALE (output) DOUBLE PRECISION array, dimension (N) Details of the permutations and scaling factors applied to the left side of A and B. If P(j) is the index of the row interchanged with row j, and D(j) is the scaling factor applied to row j, then LSCALE(j) = P(j) for J = 1,...,ILO-1 = D(j) for J = ILO,...,IHI = P(j) for J = IHI+1,...,N. The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.

RSCALE (output) DOUBLE PRECISION array, dimension (N) Details of the permutations and scaling factors applied to the right side of A and B. If P(j) is the index of the column interchanged with column j, and D(j) is the scaling factor applied to column j, then LSCALE(j) = P(j) for J = 1,...,ILO-1 = D(j) for J = ILO,...,IHI = P(j) for J = IHI+1,...,N. The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.

WORK (workspace) DOUBLE PRECISION array, dimension (lwork) lwork must be at least max(1,6*N) when JOB = 'S' or 'B', and at least 1 when JOB = 'N' or 'P'.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value.

Further Details

See R.C. WARD, Balancing the generalized eigenvalue problem, SIAM J. Sci. Stat. Comp. 2 (1981), 141-152.


.. Parameters ..

int psi::C_DGGES ( char  jobvsl,
char  jobvsr,
char  sort,
int  n,
double *  a,
int  lda,
double *  b,
int  ldb,
int *  sdim,
double *  alphar,
double *  alphai,
double *  beta,
double *  vsl,
int  ldvsl,
double *  vsr,
int  ldvsr,
double *  work,
int  lwork 
)

Purpose

DGGES computes for a pair of N-by-N real nonsymmetric matrices (A,B), the generalized eigenvalues, the generalized real Schur form (S,T), optionally, the left and/or right matrices of Schur vectors (VSL and VSR). This gives the generalized Schur factorization

     (A,B) = ( (VSL)*S*(VSR)**T, (VSL)*T*(VSR)**T )

Optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper quasi-triangular matrix S and the upper triangular matrix T.The leading columns of VSL and VSR then form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces).

(If only the generalized eigenvalues are needed, use the driver DGGEV instead, which is faster.)

A generalized eigenvalue for a pair of matrices (A,B) is a scalar w or a ratio alpha/beta = w, such that A - w*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0 or both being zero.

A pair of matrices (S,T) is in generalized real Schur form if T is upper triangular with non-negative diagonal and S is block upper triangular with 1-by-1 and 2-by-2 blocks. 1-by-1 blocks correspond to real generalized eigenvalues, while 2-by-2 blocks of S will be "standardized" by making the corresponding elements of T have the form: [ a 0 ] [ 0 b ]

and the pair of corresponding 2-by-2 blocks in S and T will have a complex conjugate pair of generalized eigenvalues.

Arguments

JOBVSL (input) CHARACTER*1 = 'N': do not compute the left Schur vectors; = 'V': compute the left Schur vectors.

JOBVSR (input) CHARACTER*1 = 'N': do not compute the right Schur vectors; = 'V': compute the right Schur vectors.

SORT (input) CHARACTER*1 Specifies whether or not to order the eigenvalues on the diagonal of the generalized Schur form. = 'N': Eigenvalues are not ordered; = 'S': Eigenvalues are ordered (see SELCTG);

SELCTG (external procedure) LOGICAL FUNCTION of three DOUBLE PRECISION arguments SELCTG must be declared EXTERNAL in the calling subroutine. If SORT = 'N', SELCTG is not referenced. If SORT = 'S', SELCTG is used to select eigenvalues to sort to the top left of the Schur form. An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected.

Note that in the ill-conditioned case, a selected complex eigenvalue may no longer satisfy SELCTG(ALPHAR(j),ALPHAI(j), BETA(j)) = .TRUE. after ordering. INFO is to be set to N+2 in this case.

N (input) INTEGER The order of the matrices A, B, VSL, and VSR. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA, N) On entry, the first of the pair of matrices. On exit, A has been overwritten by its generalized Schur form S.

LDA (input) INTEGER The leading dimension of A. LDA >= max(1,N).

B (input/output) DOUBLE PRECISION array, dimension (LDB, N) On entry, the second of the pair of matrices. On exit, B has been overwritten by its generalized Schur form T.

LDB (input) INTEGER The leading dimension of B. LDB >= max(1,N).

SDIM (output) INTEGER If SORT = 'N', SDIM = 0. If SORT = 'S', SDIM = number of eigenvalues (after sorting) for which SELCTG is true. (Complex conjugate pairs for which SELCTG is true for either eigenvalue count as 2.)

ALPHAR (output) DOUBLE PRECISION array, dimension (N) ALPHAI (output) DOUBLE PRECISION array, dimension (N) BETA (output) DOUBLE PRECISION array, dimension (N) On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i, and BETA(j),j=1,...,N are the diagonals of the complex Schur form (S,T) that would result if the 2-by-2 diagonal blocks of the real Schur form of (A,B) were further reduced to triangular form using 2-by-2 complex unitary transformations. If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) negative.

Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j) may easily over- or underflow, and BETA(j) may even be zero. Thus, the user should avoid naively computing the ratio. However, ALPHAR and ALPHAI will be always less than and usually comparable with norm(A) in magnitude, and BETA always less than and usually comparable with norm(B).

VSL (output) DOUBLE PRECISION array, dimension (LDVSL,N) If JOBVSL = 'V', VSL will contain the left Schur vectors. Not referenced if JOBVSL = 'N'.

LDVSL (input) INTEGER The leading dimension of the matrix VSL. LDVSL >=1, and if JOBVSL = 'V', LDVSL >= N.

VSR (output) DOUBLE PRECISION array, dimension (LDVSR,N) If JOBVSR = 'V', VSR will contain the right Schur vectors. Not referenced if JOBVSR = 'N'.

LDVSR (input) INTEGER The leading dimension of the matrix VSR. LDVSR >= 1, and if JOBVSR = 'V', LDVSR >= N.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. If N = 0, LWORK >= 1, else LWORK >= 8*N+16. For good performance , LWORK must generally be larger.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

BWORK (workspace) LOGICAL array, dimension (N) Not referenced if SORT = 'N'.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. = 1,...,N: The QZ iteration failed. (A,B) are not in Schur form, but ALPHAR(j), ALPHAI(j), and BETA(j) should be correct for j=INFO+1,...,N. > N: =N+1: other than QZ iteration failed in DHGEQZ. =N+2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Generalized Schur form no longer satisfy SELCTG=.TRUE. This could also be caused due to scaling. =N+3: reordering failed in DTGSEN.


.. Parameters ..

int psi::C_DGGESX ( char  jobvsl,
char  jobvsr,
char  sort,
char  sense,
int  n,
double *  a,
int  lda,
double *  b,
int  ldb,
int *  sdim,
double *  alphar,
double *  alphai,
double *  beta,
double *  vsl,
int  ldvsl,
double *  vsr,
int  ldvsr,
double *  rconde,
double *  rcondv,
double *  work,
int  lwork,
int *  iwork,
int  liwork 
)

Purpose

DGGESX computes for a pair of N-by-N real nonsymmetric matrices (A,B), the generalized eigenvalues, the real Schur form (S,T), and, optionally, the left and/or right matrices of Schur vectors (VSL and VSR). This gives the generalized Schur factorization

 (A,B) = ( (VSL) S (VSR)**T, (VSL) T (VSR)**T )

Optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper quasi-triangular matrix S and the upper triangular matrix T; computes a reciprocal condition number for the average of the selected eigenvalues (RCONDE); and computes a reciprocal condition number for the right and left deflating subspaces corresponding to the selected eigenvalues (RCONDV). The leading columns of VSL and VSR then form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces).

A generalized eigenvalue for a pair of matrices (A,B) is a scalar w or a ratio alpha/beta = w, such that A - w*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0 or for both being zero.

A pair of matrices (S,T) is in generalized real Schur form if T is upper triangular with non-negative diagonal and S is block upper triangular with 1-by-1 and 2-by-2 blocks. 1-by-1 blocks correspond to real generalized eigenvalues, while 2-by-2 blocks of S will be "standardized" by making the corresponding elements of T have the form: [ a 0 ] [ 0 b ]

and the pair of corresponding 2-by-2 blocks in S and T will have a complex conjugate pair of generalized eigenvalues.

Arguments

JOBVSL (input) CHARACTER*1 = 'N': do not compute the left Schur vectors; = 'V': compute the left Schur vectors.

JOBVSR (input) CHARACTER*1 = 'N': do not compute the right Schur vectors; = 'V': compute the right Schur vectors.

SORT (input) CHARACTER*1 Specifies whether or not to order the eigenvalues on the diagonal of the generalized Schur form. = 'N': Eigenvalues are not ordered; = 'S': Eigenvalues are ordered (see SELCTG).

SELCTG (external procedure) LOGICAL FUNCTION of three DOUBLE PRECISION arguments SELCTG must be declared EXTERNAL in the calling subroutine. If SORT = 'N', SELCTG is not referenced. If SORT = 'S', SELCTG is used to select eigenvalues to sort to the top left of the Schur form. An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected. Note that a selected complex eigenvalue may no longer satisfy SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) = .TRUE. after ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned), in this case INFO is set to N+3.

SENSE (input) CHARACTER*1 Determines which reciprocal condition numbers are computed. = 'N' : None are computed; = 'E' : Computed for average of selected eigenvalues only; = 'V' : Computed for selected deflating subspaces only; = 'B' : Computed for both. If SENSE = 'E', 'V', or 'B', SORT must equal 'S'.

N (input) INTEGER The order of the matrices A, B, VSL, and VSR. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA, N) On entry, the first of the pair of matrices. On exit, A has been overwritten by its generalized Schur form S.

LDA (input) INTEGER The leading dimension of A. LDA >= max(1,N).

B (input/output) DOUBLE PRECISION array, dimension (LDB, N) On entry, the second of the pair of matrices. On exit, B has been overwritten by its generalized Schur form T.

LDB (input) INTEGER The leading dimension of B. LDB >= max(1,N).

SDIM (output) INTEGER If SORT = 'N', SDIM = 0. If SORT = 'S', SDIM = number of eigenvalues (after sorting) for which SELCTG is true. (Complex conjugate pairs for which SELCTG is true for either eigenvalue count as 2.)

ALPHAR (output) DOUBLE PRECISION array, dimension (N) ALPHAI (output) DOUBLE PRECISION array, dimension (N) BETA (output) DOUBLE PRECISION array, dimension (N) On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i and BETA(j),j=1,...,N are the diagonals of the complex Schur form (S,T) that would result if the 2-by-2 diagonal blocks of the real Schur form of (A,B) were further reduced to triangular form using 2-by-2 complex unitary transformations. If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) negative.

Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j) may easily over- or underflow, and BETA(j) may even be zero. Thus, the user should avoid naively computing the ratio. However, ALPHAR and ALPHAI will be always less than and usually comparable with norm(A) in magnitude, and BETA always less than and usually comparable with norm(B).

VSL (output) DOUBLE PRECISION array, dimension (LDVSL,N) If JOBVSL = 'V', VSL will contain the left Schur vectors. Not referenced if JOBVSL = 'N'.

LDVSL (input) INTEGER The leading dimension of the matrix VSL. LDVSL >=1, and if JOBVSL = 'V', LDVSL >= N.

VSR (output) DOUBLE PRECISION array, dimension (LDVSR,N) If JOBVSR = 'V', VSR will contain the right Schur vectors. Not referenced if JOBVSR = 'N'.

LDVSR (input) INTEGER The leading dimension of the matrix VSR. LDVSR >= 1, and if JOBVSR = 'V', LDVSR >= N.

RCONDE (output) DOUBLE PRECISION array, dimension ( 2 ) If SENSE = 'E' or 'B', RCONDE(1) and RCONDE(2) contain the reciprocal condition numbers for the average of the selected eigenvalues. Not referenced if SENSE = 'N' or 'V'.

RCONDV (output) DOUBLE PRECISION array, dimension ( 2 ) If SENSE = 'V' or 'B', RCONDV(1) and RCONDV(2) contain the reciprocal condition numbers for the selected deflating subspaces. Not referenced if SENSE = 'N' or 'E'.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. If N = 0, LWORK >= 1, else if SENSE = 'E', 'V', or 'B', LWORK >= max( 8*N, 6*N+16, 2*SDIM*(N-SDIM) ), else LWORK >= max( 8*N, 6*N+16 ). Note that 2*SDIM*(N-SDIM) <= N*N/2. Note also that an error is only returned if LWORK < max( 8*N, 6*N+16), but if SENSE = 'E' or 'V' or 'B' this may not be large enough.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the bound on the optimal size of the WORK array and the minimum size of the IWORK array, returns these values as the first entries of the WORK and IWORK arrays, and no error message related to LWORK or LIWORK is issued by XERBLA.

IWORK (workspace) INTEGER array, dimension (MAX(1,LIWORK)) On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.

LIWORK (input) INTEGER The dimension of the array IWORK. If SENSE = 'N' or N = 0, LIWORK >= 1, otherwise LIWORK >= N+6.

If LIWORK = -1, then a workspace query is assumed; the routine only calculates the bound on the optimal size of the WORK array and the minimum size of the IWORK array, returns these values as the first entries of the WORK and IWORK arrays, and no error message related to LWORK or LIWORK is issued by XERBLA.

BWORK (workspace) LOGICAL array, dimension (N) Not referenced if SORT = 'N'.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. = 1,...,N: The QZ iteration failed. (A,B) are not in Schur form, but ALPHAR(j), ALPHAI(j), and BETA(j) should be correct for j=INFO+1,...,N. > N: =N+1: other than QZ iteration failed in DHGEQZ =N+2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Generalized Schur form no longer satisfy SELCTG=.TRUE. This could also be caused due to scaling. =N+3: reordering failed in DTGSEN.

Further Details

An approximate (asymptotic) bound on the average absolute error of the selected eigenvalues is

 EPS * norm((A, B)) / RCONDE( 1 ).

An approximate (asymptotic) bound on the maximum angular error in the computed deflating subspaces is

 EPS * norm((A, B)) / RCONDV( 2 ).

See LAPACK User's Guide, section 4.11 for more information.


.. Parameters ..

int psi::C_DGGEV ( char  jobvl,
char  jobvr,
int  n,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  alphar,
double *  alphai,
double *  beta,
double *  vl,
int  ldvl,
double *  vr,
int  ldvr,
double *  work,
int  lwork 
)

Purpose

DGGEV computes for a pair of N-by-N real nonsymmetric matrices (A,B) the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors.

A generalized eigenvalue for a pair of matrices (A,B) is a scalar lambda or a ratio alpha/beta = lambda, such that A - lambda*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0, and even for both being zero.

The right eigenvector v(j) corresponding to the eigenvalue lambda(j) of (A,B) satisfies

             A * v(j) = lambda(j) * B * v(j).

The left eigenvector u(j) corresponding to the eigenvalue lambda(j) of (A,B) satisfies

             u(j)**H * A  = lambda(j) * u(j)**H * B .

where u(j)**H is the conjugate-transpose of u(j).

Arguments

JOBVL (input) CHARACTER*1 = 'N': do not compute the left generalized eigenvectors; = 'V': compute the left generalized eigenvectors.

JOBVR (input) CHARACTER*1 = 'N': do not compute the right generalized eigenvectors; = 'V': compute the right generalized eigenvectors.

N (input) INTEGER The order of the matrices A, B, VL, and VR. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA, N) On entry, the matrix A in the pair (A,B). On exit, A has been overwritten.

LDA (input) INTEGER The leading dimension of A. LDA >= max(1,N).

B (input/output) DOUBLE PRECISION array, dimension (LDB, N) On entry, the matrix B in the pair (A,B). On exit, B has been overwritten.

LDB (input) INTEGER The leading dimension of B. LDB >= max(1,N).

ALPHAR (output) DOUBLE PRECISION array, dimension (N) ALPHAI (output) DOUBLE PRECISION array, dimension (N) BETA (output) DOUBLE PRECISION array, dimension (N) On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will be the generalized eigenvalues. If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) negative.

Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j) may easily over- or underflow, and BETA(j) may even be zero. Thus, the user should avoid naively computing the ratio alpha/beta. However, ALPHAR and ALPHAI will be always less than and usually comparable with norm(A) in magnitude, and BETA always less than and usually comparable with norm(B).

VL (output) DOUBLE PRECISION array, dimension (LDVL,N) If JOBVL = 'V', the left eigenvectors u(j) are stored one after another in the columns of VL, in the same order as their eigenvalues. If the j-th eigenvalue is real, then u(j) = VL(:,j), the j-th column of VL. If the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)-i*VL(:,j+1). Each eigenvector is scaled so the largest component has abs(real part)+abs(imag. part)=1. Not referenced if JOBVL = 'N'.

LDVL (input) INTEGER The leading dimension of the matrix VL. LDVL >= 1, and if JOBVL = 'V', LDVL >= N.

VR (output) DOUBLE PRECISION array, dimension (LDVR,N) If JOBVR = 'V', the right eigenvectors v(j) are stored one after another in the columns of VR, in the same order as their eigenvalues. If the j-th eigenvalue is real, then v(j) = VR(:,j), the j-th column of VR. If the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)-i*VR(:,j+1). Each eigenvector is scaled so the largest component has abs(real part)+abs(imag. part)=1. Not referenced if JOBVR = 'N'.

LDVR (input) INTEGER The leading dimension of the matrix VR. LDVR >= 1, and if JOBVR = 'V', LDVR >= N.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,8*N). For good performance, LWORK must generally be larger.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. = 1,...,N: The QZ iteration failed. No eigenvectors have been calculated, but ALPHAR(j), ALPHAI(j), and BETA(j) should be correct for j=INFO+1,...,N. > N: =N+1: other than QZ iteration failed in DHGEQZ. =N+2: error return from DTGEVC.


.. Parameters ..

int psi::C_DGGEVX ( char  balanc,
char  jobvl,
char  jobvr,
char  sense,
int  n,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  alphar,
double *  alphai,
double *  beta,
double *  vl,
int  ldvl,
double *  vr,
int  ldvr,
int *  ilo,
int *  ihi,
double *  lscale,
double *  rscale,
double *  abnrm,
double *  bbnrm,
double *  rconde,
double *  rcondv,
double *  work,
int  lwork,
int *  iwork 
)

Purpose

DGGEVX computes for a pair of N-by-N real nonsymmetric matrices (A,B) the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors.

Optionally also, it computes a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors (ILO, IHI, LSCALE, RSCALE, ABNRM, and BBNRM), reciprocal condition numbers for the eigenvalues (RCONDE), and reciprocal condition numbers for the right eigenvectors (RCONDV).

A generalized eigenvalue for a pair of matrices (A,B) is a scalar lambda or a ratio alpha/beta = lambda, such that A - lambda*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0, and even for both being zero.

The right eigenvector v(j) corresponding to the eigenvalue lambda(j) of (A,B) satisfies

             A * v(j) = lambda(j) * B * v(j) .

The left eigenvector u(j) corresponding to the eigenvalue lambda(j) of (A,B) satisfies

             u(j)**H * A  = lambda(j) * u(j)**H * B.

where u(j)**H is the conjugate-transpose of u(j).

Arguments

BALANC (input) CHARACTER*1 Specifies the balance option to be performed. = 'N': do not diagonally scale or permute; = 'P': permute only; = 'S': scale only; = 'B': both permute and scale. Computed reciprocal condition numbers will be for the matrices after permuting and/or balancing. Permuting does not change condition numbers (in exact arithmetic), but balancing does.

JOBVL (input) CHARACTER*1 = 'N': do not compute the left generalized eigenvectors; = 'V': compute the left generalized eigenvectors.

JOBVR (input) CHARACTER*1 = 'N': do not compute the right generalized eigenvectors; = 'V': compute the right generalized eigenvectors.

SENSE (input) CHARACTER*1 Determines which reciprocal condition numbers are computed. = 'N': none are computed; = 'E': computed for eigenvalues only; = 'V': computed for eigenvectors only; = 'B': computed for eigenvalues and eigenvectors.

N (input) INTEGER The order of the matrices A, B, VL, and VR. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA, N) On entry, the matrix A in the pair (A,B). On exit, A has been overwritten. If JOBVL='V' or JOBVR='V' or both, then A contains the first part of the real Schur form of the "balanced" versions of the input A and B.

LDA (input) INTEGER The leading dimension of A. LDA >= max(1,N).

B (input/output) DOUBLE PRECISION array, dimension (LDB, N) On entry, the matrix B in the pair (A,B). On exit, B has been overwritten. If JOBVL='V' or JOBVR='V' or both, then B contains the second part of the real Schur form of the "balanced" versions of the input A and B.

LDB (input) INTEGER The leading dimension of B. LDB >= max(1,N).

ALPHAR (output) DOUBLE PRECISION array, dimension (N) ALPHAI (output) DOUBLE PRECISION array, dimension (N) BETA (output) DOUBLE PRECISION array, dimension (N) On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will be the generalized eigenvalues. If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) negative.

Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j) may easily over- or underflow, and BETA(j) may even be zero. Thus, the user should avoid naively computing the ratio ALPHA/BETA. However, ALPHAR and ALPHAI will be always less than and usually comparable with norm(A) in magnitude, and BETA always less than and usually comparable with norm(B).

VL (output) DOUBLE PRECISION array, dimension (LDVL,N) If JOBVL = 'V', the left eigenvectors u(j) are stored one after another in the columns of VL, in the same order as their eigenvalues. If the j-th eigenvalue is real, then u(j) = VL(:,j), the j-th column of VL. If the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)-i*VL(:,j+1). Each eigenvector will be scaled so the largest component have abs(real part) + abs(imag. part) = 1. Not referenced if JOBVL = 'N'.

LDVL (input) INTEGER The leading dimension of the matrix VL. LDVL >= 1, and if JOBVL = 'V', LDVL >= N.

VR (output) DOUBLE PRECISION array, dimension (LDVR,N) If JOBVR = 'V', the right eigenvectors v(j) are stored one after another in the columns of VR, in the same order as their eigenvalues. If the j-th eigenvalue is real, then v(j) = VR(:,j), the j-th column of VR. If the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)-i*VR(:,j+1). Each eigenvector will be scaled so the largest component have abs(real part) + abs(imag. part) = 1. Not referenced if JOBVR = 'N'.

LDVR (input) INTEGER The leading dimension of the matrix VR. LDVR >= 1, and if JOBVR = 'V', LDVR >= N.

ILO (output) INTEGER IHI (output) INTEGER ILO and IHI are integer values such that on exit A(i,j) = 0 and B(i,j) = 0 if i > j and j = 1,...,ILO-1 or i = IHI+1,...,N. If BALANC = 'N' or 'S', ILO = 1 and IHI = N.

LSCALE (output) DOUBLE PRECISION array, dimension (N) Details of the permutations and scaling factors applied to the left side of A and B. If PL(j) is the index of the row interchanged with row j, and DL(j) is the scaling factor applied to row j, then LSCALE(j) = PL(j) for j = 1,...,ILO-1 = DL(j) for j = ILO,...,IHI = PL(j) for j = IHI+1,...,N. The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.

RSCALE (output) DOUBLE PRECISION array, dimension (N) Details of the permutations and scaling factors applied to the right side of A and B. If PR(j) is the index of the column interchanged with column j, and DR(j) is the scaling factor applied to column j, then RSCALE(j) = PR(j) for j = 1,...,ILO-1 = DR(j) for j = ILO,...,IHI = PR(j) for j = IHI+1,...,N The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.

ABNRM (output) DOUBLE PRECISION The one-norm of the balanced matrix A.

BBNRM (output) DOUBLE PRECISION The one-norm of the balanced matrix B.

RCONDE (output) DOUBLE PRECISION array, dimension (N) If SENSE = 'E' or 'B', the reciprocal condition numbers of the eigenvalues, stored in consecutive elements of the array. For a complex conjugate pair of eigenvalues two consecutive elements of RCONDE are set to the same value. Thus RCONDE(j), RCONDV(j), and the j-th columns of VL and VR all correspond to the j-th eigenpair. If SENSE = 'N or 'V', RCONDE is not referenced.

RCONDV (output) DOUBLE PRECISION array, dimension (N) If SENSE = 'V' or 'B', the estimated reciprocal condition numbers of the eigenvectors, stored in consecutive elements of the array. For a complex eigenvector two consecutive elements of RCONDV are set to the same value. If the eigenvalues cannot be reordered to compute RCONDV(j), RCONDV(j) is set to 0; this can only occur when the true value would be very small anyway. If SENSE = 'N' or 'E', RCONDV is not referenced.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,2*N). If BALANC = 'S' or 'B', or JOBVL = 'V', or JOBVR = 'V', LWORK >= max(1,6*N). If SENSE = 'E' or 'B', LWORK >= max(1,10*N). If SENSE = 'V' or 'B', LWORK >= 2*N*N+8*N+16.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

IWORK (workspace) INTEGER array, dimension (N+6) If SENSE = 'E', IWORK is not referenced.

BWORK (workspace) LOGICAL array, dimension (N) If SENSE = 'N', BWORK is not referenced.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. = 1,...,N: The QZ iteration failed. No eigenvectors have been calculated, but ALPHAR(j), ALPHAI(j), and BETA(j) should be correct for j=INFO+1,...,N. > N: =N+1: other than QZ iteration failed in DHGEQZ. =N+2: error return from DTGEVC.

Further Details

Balancing a matrix pair (A,B) includes, first, permuting rows and columns to isolate eigenvalues, second, applying diagonal similarity transformation to the rows and columns to make the rows and columns as close in norm as possible. The computed reciprocal condition numbers correspond to the balanced matrix. Permuting rows and columns will not change the condition numbers (in exact arithmetic) but diagonal scaling will. For further explanation of balancing, see section 4.11.1.2 of LAPACK Users' Guide.

An approximate error bound on the chordal distance between the i-th computed generalized eigenvalue w and the corresponding exact eigenvalue lambda is

 chord(w, lambda) <= EPS * norm(ABNRM, BBNRM) / RCONDE(I)

An approximate error bound for the angle between the i-th computed eigenvector VL(i) or VR(i) is given by

 EPS * norm(ABNRM, BBNRM) / DIF(i).

For further explanation of the reciprocal condition numbers RCONDE and RCONDV, see section 4.11 of LAPACK User's Guide.


.. Parameters ..

int psi::C_DGGGLM ( int  n,
int  m,
int  p,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  d,
double *  x,
double *  y,
double *  work,
int  lwork 
)

Purpose

DGGGLM solves a general Gauss-Markov linear model (GLM) problem:

    minimize || y ||_2   subject to   d = A*x + B*y
        x

where A is an N-by-M matrix, B is an N-by-P matrix, and d is a given N-vector. It is assumed that M <= N <= M+P, and

       rank(A) = M    and    rank( A B ) = N.

Under these assumptions, the constrained equation is always consistent, and there is a unique solution x and a minimal 2-norm solution y, which is obtained using a generalized QR factorization of the matrices (A, B) given by

A = Q*(R), B = Q*T*Z. (0)

In particular, if matrix B is square nonsingular, then the problem GLM is equivalent to the following weighted linear least squares problem

         minimize || inv(B)*(d-A*x) ||_2
             x

where inv(B) denotes the inverse of B.

Arguments

N (input) INTEGER The number of rows of the matrices A and B. N >= 0.

M (input) INTEGER The number of columns of the matrix A. 0 <= M <= N.

P (input) INTEGER The number of columns of the matrix B. P >= N-M.

A (input/output) DOUBLE PRECISION array, dimension (LDA,M) On entry, the N-by-M matrix A. On exit, the upper triangular part of the array A contains the M-by-M upper triangular matrix R.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

B (input/output) DOUBLE PRECISION array, dimension (LDB,P) On entry, the N-by-P matrix B. On exit, if N <= P, the upper triangle of the subarray B(1:N,P-N+1:P) contains the N-by-N upper triangular matrix T; if N > P, the elements on and above the (N-P)th subdiagonal contain the N-by-P upper trapezoidal matrix T.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

D (input/output) DOUBLE PRECISION array, dimension (N) On entry, D is the left hand side of the GLM equation. On exit, D is destroyed.

X (output) DOUBLE PRECISION array, dimension (M) Y (output) DOUBLE PRECISION array, dimension (P) On exit, X and Y are the solutions of the GLM problem.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,N+M+P). For optimum performance, LWORK >= M+min(N,P)+max(N,P)*NB, where NB is an upper bound for the optimal blocksizes for DGEQRF, SGERQF, DORMQR and SORMRQ.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value. = 1: the upper triangular factor R associated with A in the generalized QR factorization of the pair (A, B) is singular, so that rank(A) < M; the least squares solution could not be computed. = 2: the bottom (N-M) by (N-M) part of the upper trapezoidal factor T associated with B in the generalized QR factorization of the pair (A, B) is singular, so that rank( A B ) < N; the least squares solution could not be computed.


.. Parameters ..

int psi::C_DGGHRD ( char  compq,
char  compz,
int  n,
int  ilo,
int  ihi,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  q,
int  ldq,
double *  z,
int  ldz 
)

Purpose

DGGHRD reduces a pair of real matrices (A,B) to generalized upper Hessenberg form using orthogonal transformations, where A is a general matrix and B is upper triangular. The form of the generalized eigenvalue problem is A*x = lambda*B*x, and B is typically made upper triangular by computing its QR factorization and moving the orthogonal matrix Q to the left side of the equation.

This subroutine simultaneously reduces A to a Hessenberg matrix H: Q**T*A*Z = H and transforms B to another upper triangular matrix T: Q**T*B*Z = T in order to reduce the problem to its standard form H*y = lambda*T*y where y = Z**T*x.

The orthogonal matrices Q and Z are determined as products of Givens rotations. They may either be formed explicitly, or they may be postmultiplied into input matrices Q1 and Z1, so that

 Q1 * A * Z1**T = (Q1*Q) * H * (Z1*Z)**T

 Q1 * B * Z1**T = (Q1*Q) * T * (Z1*Z)**T

If Q1 is the orthogonal matrix from the QR factorization of B in the original equation A*x = lambda*B*x, then DGGHRD reduces the original problem to generalized Hessenberg form.

Arguments

COMPQ (input) CHARACTER*1 = 'N': do not compute Q; = 'I': Q is initialized to the unit matrix, and the orthogonal matrix Q is returned; = 'V': Q must contain an orthogonal matrix Q1 on entry, and the product Q1*Q is returned.

COMPZ (input) CHARACTER*1 = 'N': do not compute Z; = 'I': Z is initialized to the unit matrix, and the orthogonal matrix Z is returned; = 'V': Z must contain an orthogonal matrix Z1 on entry, and the product Z1*Z is returned.

N (input) INTEGER The order of the matrices A and B. N >= 0.

ILO (input) INTEGER IHI (input) INTEGER ILO and IHI mark the rows and columns of A which are to be reduced. It is assumed that A is already upper triangular in rows and columns 1:ILO-1 and IHI+1:N. ILO and IHI are normally set by a previous call to SGGBAL; otherwise they should be set to 1 and N respectively. 1 <= ILO <= IHI <= N, if N > 0; ILO=1 and IHI=0, if N=0.

A (input/output) DOUBLE PRECISION array, dimension (LDA, N) On entry, the N-by-N general matrix to be reduced. On exit, the upper triangle and the first subdiagonal of A are overwritten with the upper Hessenberg matrix H, and the rest is set to zero.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

B (input/output) DOUBLE PRECISION array, dimension (LDB, N) On entry, the N-by-N upper triangular matrix B. On exit, the upper triangular matrix T = Q**T B Z. The elements below the diagonal are set to zero.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

Q (input/output) DOUBLE PRECISION array, dimension (LDQ, N) On entry, if COMPQ = 'V', the orthogonal matrix Q1, typically from the QR factorization of B. On exit, if COMPQ='I', the orthogonal matrix Q, and if COMPQ = 'V', the product Q1*Q. Not referenced if COMPQ='N'.

LDQ (input) INTEGER The leading dimension of the array Q. LDQ >= N if COMPQ='V' or 'I'; LDQ >= 1 otherwise.

Z (input/output) DOUBLE PRECISION array, dimension (LDZ, N) On entry, if COMPZ = 'V', the orthogonal matrix Z1. On exit, if COMPZ='I', the orthogonal matrix Z, and if COMPZ = 'V', the product Z1*Z. Not referenced if COMPZ='N'.

LDZ (input) INTEGER The leading dimension of the array Z. LDZ >= N if COMPZ='V' or 'I'; LDZ >= 1 otherwise.

C++ Return value: INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value.

Further Details

This routine reduces A to Hessenberg and B to triangular form by an unblocked reduction, as described in Matrix_Computations, by Golub and Van Loan (Johns Hopkins Press.)


.. Parameters ..

int psi::C_DGGLSE ( int  m,
int  n,
int  p,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  c,
double *  d,
double *  x,
double *  work,
int  lwork 
)

Purpose

DGGLSE solves the linear equality-constrained least squares (LSE) problem:

    minimize || c - A*x ||_2   subject to   B*x = d

where A is an M-by-N matrix, B is a P-by-N matrix, c is a given M-vector, and d is a given P-vector. It is assumed that P <= N <= M+P, and

     rank(B) = P and  rank( (A) ) = N.
                          ( (B) )

These conditions ensure that the LSE problem has a unique solution, which is obtained using a generalized RQ factorization of the matrices (B, A) given by

B = (0 R)*Q, A = Z*T*Q.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrices A and B. N >= 0.

P (input) INTEGER The number of rows of the matrix B. 0 <= P <= N <= M+P.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, the elements on and above the diagonal of the array contain the min(M,N)-by-N upper trapezoidal matrix T.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

B (input/output) DOUBLE PRECISION array, dimension (LDB,N) On entry, the P-by-N matrix B. On exit, the upper triangle of the subarray B(1:P,N-P+1:N) contains the P-by-P upper triangular matrix R.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,P).

C (input/output) DOUBLE PRECISION array, dimension (M) On entry, C contains the right hand side vector for the least squares part of the LSE problem. On exit, the residual sum of squares for the solution is given by the sum of squares of elements N-P+1 to M of vector C.

D (input/output) DOUBLE PRECISION array, dimension (P) On entry, D contains the right hand side vector for the constrained equation. On exit, D is destroyed.

X (output) DOUBLE PRECISION array, dimension (N) On exit, X is the solution of the LSE problem.

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,M+N+P). For optimum performance LWORK >= P+min(M,N)+max(M,N)*NB, where NB is an upper bound for the optimal blocksizes for DGEQRF, SGERQF, DORMQR and SORMRQ.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value. = 1: the upper triangular factor R associated with B in the generalized RQ factorization of the pair (B, A) is singular, so that rank(B) < P; the least squares solution could not be computed. = 2: the (N-P) by (N-P) part of the upper trapezoidal factor T associated with A in the generalized RQ factorization of the pair (B, A) is singular, so that rank( (A) ) < N; the least squares solution could not ( (B) ) be computed.


.. Parameters ..

int psi::C_DGGQRF ( int  n,
int  m,
int  p,
double *  a,
int  lda,
double *  taua,
double *  b,
int  ldb,
double *  taub,
double *  work,
int  lwork 
)

Purpose

DGGQRF computes a generalized QR factorization of an N-by-M matrix A and an N-by-P matrix B:

        A = Q*R,        B = Q*T*Z,

where Q is an N-by-N orthogonal matrix, Z is a P-by-P orthogonal matrix, and R and T assume one of the forms:

if N >= M, R = ( R11 ) M , or if N < M, R = ( R11 R12 ) N, ( 0 ) N-M N M-N M

where R11 is upper triangular, and

if N <= P, T = ( 0 T12 ) N, or if N > P, T = ( T11 ) N-P, P-N N ( T21 ) P P

where T12 or T21 is upper triangular.

In particular, if B is square and nonsingular, the GQR factorization of A and B implicitly gives the QR factorization of inv(B)*A:

         inv(B)*A = Z'*(inv(T)*R)

where inv(B) denotes the inverse of the matrix B, and Z' denotes the transpose of the matrix Z.

Arguments

N (input) INTEGER The number of rows of the matrices A and B. N >= 0.

M (input) INTEGER The number of columns of the matrix A. M >= 0.

P (input) INTEGER The number of columns of the matrix B. P >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,M) On entry, the N-by-M matrix A. On exit, the elements on and above the diagonal of the array contain the min(N,M)-by-M upper trapezoidal matrix R (R is upper triangular if N >= M); the elements below the diagonal, with the array TAUA, represent the orthogonal matrix Q as a product of min(N,M) elementary reflectors (see Further Details).

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,N).

TAUA (output) DOUBLE PRECISION array, dimension (min(N,M)) The scalar factors of the elementary reflectors which represent the orthogonal matrix Q (see Further Details).

B (input/output) DOUBLE PRECISION array, dimension (LDB,P) On entry, the N-by-P matrix B. On exit, if N <= P, the upper triangle of the subarray B(1:N,P-N+1:P) contains the N-by-N upper triangular matrix T; if N > P, the elements on and above the (N-P)-th subdiagonal contain the N-by-P upper trapezoidal matrix T; the remaining elements, with the array TAUB, represent the orthogonal matrix Z as a product of elementary reflectors (see Further Details).

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

TAUB (output) DOUBLE PRECISION array, dimension (min(N,P)) The scalar factors of the elementary reflectors which represent the orthogonal matrix Z (see Further Details).

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,N,M,P). For optimum performance LWORK >= max(N,M,P)*max(NB1,NB2,NB3), where NB1 is the optimal blocksize for the QR factorization of an N-by-M matrix, NB2 is the optimal blocksize for the RQ factorization of an N-by-P matrix, and NB3 is the optimal blocksize for a call of DORMQR.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value.

Further Details

The matrix Q is represented as a product of elementary reflectors

Q = H(1) H(2) . . . H(k), where k = min(n,m).

Each H(i) has the form

H(i) = I - taua * v * v'

where taua is a real scalar, and v is a real vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i+1:n,i), and taua in TAUA(i). To form Q explicitly, use LAPACK subroutine DORGQR. To use Q to update another matrix, use LAPACK subroutine DORMQR.

The matrix Z is represented as a product of elementary reflectors

Z = H(1) H(2) . . . H(k), where k = min(n,p).

Each H(i) has the form

H(i) = I - taub * v * v'

where taub is a real scalar, and v is a real vector with v(p-k+i+1:p) = 0 and v(p-k+i) = 1; v(1:p-k+i-1) is stored on exit in B(n-k+i,1:p-k+i-1), and taub in TAUB(i). To form Z explicitly, use LAPACK subroutine DORGRQ. To use Z to update another matrix, use LAPACK subroutine DORMRQ.


.. Local Scalars ..

int psi::C_DGGRQF ( int  m,
int  p,
int  n,
double *  a,
int  lda,
double *  taua,
double *  b,
int  ldb,
double *  taub,
double *  work,
int  lwork 
)

Purpose

DGGRQF computes a generalized RQ factorization of an M-by-N matrix A and a P-by-N matrix B:

        A = R*Q,        B = Z*T*Q,

where Q is an N-by-N orthogonal matrix, Z is a P-by-P orthogonal matrix, and R and T assume one of the forms:

if M <= N, R = ( 0 R12 ) M, or if M > N, R = ( R11 ) M-N, N-M M ( R21 ) N N

where R12 or R21 is upper triangular, and

if P >= N, T = ( T11 ) N , or if P < N, T = ( T11 T12 ) P, ( 0 ) P-N P N-P N

where T11 is upper triangular.

In particular, if B is square and nonsingular, the GRQ factorization of A and B implicitly gives the RQ factorization of A*inv(B):

         A*inv(B) = (R*inv(T))*Z'

where inv(B) denotes the inverse of the matrix B, and Z' denotes the transpose of the matrix Z.

Arguments

M (input) INTEGER The number of rows of the matrix A. M >= 0.

P (input) INTEGER The number of rows of the matrix B. P >= 0.

N (input) INTEGER The number of columns of the matrices A and B. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, if M <= N, the upper triangle of the subarray A(1:M,N-M+1:N) contains the M-by-M upper triangular matrix R; if M > N, the elements on and above the (M-N)-th subdiagonal contain the M-by-N upper trapezoidal matrix R; the remaining elements, with the array TAUA, represent the orthogonal matrix Q as a product of elementary reflectors (see Further Details).

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

TAUA (output) DOUBLE PRECISION array, dimension (min(M,N)) The scalar factors of the elementary reflectors which represent the orthogonal matrix Q (see Further Details).

B (input/output) DOUBLE PRECISION array, dimension (LDB,N) On entry, the P-by-N matrix B. On exit, the elements on and above the diagonal of the array contain the min(P,N)-by-N upper trapezoidal matrix T (T is upper triangular if P >= N); the elements below the diagonal, with the array TAUB, represent the orthogonal matrix Z as a product of elementary reflectors (see Further Details).

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,P).

TAUB (output) DOUBLE PRECISION array, dimension (min(P,N)) The scalar factors of the elementary reflectors which represent the orthogonal matrix Z (see Further Details).

WORK (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.

LWORK (input) INTEGER The dimension of the array WORK. LWORK >= max(1,N,M,P). For optimum performance LWORK >= max(N,M,P)*max(NB1,NB2,NB3), where NB1 is the optimal blocksize for the RQ factorization of an M-by-N matrix, NB2 is the optimal blocksize for the QR factorization of a P-by-N matrix, and NB3 is the optimal blocksize for a call of DORMRQ.

If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INF0= -i, the i-th argument had an illegal value.

Further Details

The matrix Q is represented as a product of elementary reflectors

Q = H(1) H(2) . . . H(k), where k = min(m,n).

Each H(i) has the form

H(i) = I - taua * v * v'

where taua is a real scalar, and v is a real vector with v(n-k+i+1:n) = 0 and v(n-k+i) = 1; v(1:n-k+i-1) is stored on exit in A(m-k+i,1:n-k+i-1), and taua in TAUA(i). To form Q explicitly, use LAPACK subroutine DORGRQ. To use Q to update another matrix, use LAPACK subroutine DORMRQ.

The matrix Z is represented as a product of elementary reflectors

Z = H(1) H(2) . . . H(k), where k = min(p,n).

Each H(i) has the form

H(i) = I - taub * v * v'

where taub is a real scalar, and v is a real vector with v(1:i-1) = 0 and v(i) = 1; v(i+1:p) is stored on exit in B(i+1:p,i), and taub in TAUB(i). To form Z explicitly, use LAPACK subroutine DORGQR. To use Z to update another matrix, use LAPACK subroutine DORMQR.


.. Local Scalars ..

int psi::C_DGGSVD ( char  jobu,
char  jobv,
char  jobq,
int  m,
int  n,
int  p,
int *  k,
int *  l,
double *  a,
int  lda,
double *  b,
int  ldb,
double *  alpha,
double *  beta,
double *  u,
int  ldu,
double *  v,
int  ldv,
double *  q,
int  ldq,
double *  work,
int *  iwork 
)

Purpose

DGGSVD computes the generalized singular value decomposition (GSVD) of an M-by-N real matrix A and P-by-N real matrix B:

U'*A*Q = D1*( 0 R ),    V'*B*Q = D2*( 0 R )

where U, V and Q are orthogonal matrices, and Z' is the transpose of Z. Let K+L = the effective numerical rank of the matrix (A',B')', then R is a K+L-by-K+L nonsingular upper triangular matrix, D1 and D2 are M-by-(K+L) and P-by-(K+L) "diagonal" matrices and of the following structures, respectively:

If M-K-L >= 0,

                K  L
   D1 =     K ( I  0 )
            L ( 0  C )
        M-K-L ( 0  0 )

              K  L
   D2 =   L ( 0  S )
        P-L ( 0  0 )

            N-K-L  K    L

( 0 R ) = K ( 0 R11 R12 ) L ( 0 0 R22 )

where

C = diag( ALPHA(K+1), ... , ALPHA(K+L) ), S = diag( BETA(K+1), ... , BETA(K+L) ), C**2 + S**2 = I.

R is stored in A(1:K+L,N-K-L+1:N) on exit.

If M-K-L < 0,

              K M-K K+L-M
   D1 =   K ( I  0    0   )
        M-K ( 0  C    0   )

                K M-K K+L-M
   D2 =   M-K ( 0  S    0  )
        K+L-M ( 0  0    I  )
          P-L ( 0  0    0  )

               N-K-L  K   M-K  K+L-M

( 0 R ) = K ( 0 R11 R12 R13 ) M-K ( 0 0 R22 R23 ) K+L-M ( 0 0 0 R33 )

where

C = diag( ALPHA(K+1), ... , ALPHA(M) ), S = diag( BETA(K+1), ... , BETA(M) ), C**2 + S**2 = I.

(R11 R12 R13 ) is stored in A(1:M, N-K-L+1:N), and R33 is stored ( 0 R22 R23 ) in B(M-K+1:L,N+M-K-L+1:N) on exit.

The routine computes C, S, R, and optionally the orthogonal transformation matrices U, V and Q.

In particular, if B is an N-by-N nonsingular matrix, then the GSVD of A and B implicitly gives the SVD of A*inv(B): A*inv(B) = U*(D1*inv(D2))*V'. If ( A',B')' has orthonormal columns, then the GSVD of A and B is also equal to the CS decomposition of A and B. Furthermore, the GSVD can be used to derive the solution of the eigenvalue problem: A'A x = lambda B'*B x. In some literature, the GSVD of A and B is presented in the form U'*A*X = ( 0 D1 ), V'*B*X = ( 0 D2 ) where U and V are orthogonal and X is nonsingular, D1 and D2 are ``diagonal''. The former GSVD form can be converted to the latter form by taking the nonsingular matrix X as

                 X = Q*( I   0    )
                       ( 0 inv(R) ).

Arguments

JOBU (input) CHARACTER*1 = 'U': Orthogonal matrix U is computed; = 'N': U is not computed.

JOBV (input) CHARACTER*1 = 'V': Orthogonal matrix V is computed; = 'N': V is not computed.

JOBQ (input) CHARACTER*1 = 'Q': Orthogonal matrix Q is computed; = 'N': Q is not computed.

M (input) INTEGER The number of rows of the matrix A. M >= 0.

N (input) INTEGER The number of columns of the matrices A and B. N >= 0.

P (input) INTEGER The number of rows of the matrix B. P >= 0.

K (output) INTEGER L (output) INTEGER On exit, K and L specify the dimension of the subblocks described in the Purpose section. K + L = effective numerical rank of (A',B')'.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A contains the triangular matrix R, or part of R. See Purpose for details.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

B (input/output) DOUBLE PRECISION array, dimension (LDB,N) On entry, the P-by-N matrix B. On exit, B contains the triangular matrix R if M-K-L < 0. See Purpose for details.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,P).

ALPHA (output) DOUBLE PRECISION array, dimension (N) BETA (output) DOUBLE PRECISION array, dimension (N) On exit, ALPHA and BETA contain the generalized singular value pairs of A and B; ALPHA(1:K) = 1, BETA(1:K) = 0, and if M-K-L >= 0, ALPHA(K+1:K+L) = C, BETA(K+1:K+L) = S, or if M-K-L < 0, ALPHA(K+1:M)=C, ALPHA(M+1:K+L)=0 BETA(K+1:M) =S, BETA(M+1:K+L) =1 and ALPHA(K+L+1:N) = 0 BETA(K+L+1:N) = 0

U (output) DOUBLE PRECISION array, dimension (LDU,M) If JOBU = 'U', U contains the M-by-M orthogonal matrix U. If JOBU = 'N', U is not referenced.

LDU (input) INTEGER The leading dimension of the array U. LDU >= max(1,M) if JOBU = 'U'; LDU >= 1 otherwise.

V (output) DOUBLE PRECISION array, dimension (LDV,P) If JOBV = 'V', V contains the P-by-P orthogonal matrix V. If JOBV = 'N', V is not referenced.

LDV (input) INTEGER The leading dimension of the array V. LDV >= max(1,P) if JOBV = 'V'; LDV >= 1 otherwise.

Q (output) DOUBLE PRECISION array, dimension (LDQ,N) If JOBQ = 'Q', Q contains the N-by-N orthogonal matrix Q. If JOBQ = 'N', Q is not referenced.

LDQ (input) INTEGER The leading dimension of the array Q. LDQ >= max(1,N) if JOBQ = 'Q'; LDQ >= 1 otherwise.

WORK (workspace) DOUBLE PRECISION array, dimension (max(3*N,M,P)+N)

IWORK (workspace/output) INTEGER array, dimension (N) On exit, IWORK stores the sorting information. More precisely, the following loop will sort ALPHA for I = K+1, min(M,K+L) swap ALPHA(I) and ALPHA(IWORK(I)) endfor such that ALPHA(1) >= ALPHA(2) >= ... >= ALPHA(N).

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value. > 0: if INFO = 1, the Jacobi-type procedure failed to converge. For further details, see subroutine DTGSJA.

Internal Parameters

TOLA DOUBLE PRECISION TOLB DOUBLE PRECISION TOLA and TOLB are the thresholds to determine the effective rank of (A',B')'. Generally, they are set to TOLA = MAX(M,N)*norm(A)*MAZHEPS, TOLB = MAX(P,N)*norm(B)*MAZHEPS. The size of TOLA and TOLB may affect the size of backward errors of the decomposition.

Further Details

2-96 Based on modifications by Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA


.. Local Scalars ..

int psi::C_DGGSVP ( char  jobu,
char  jobv,
char  jobq,
int  m,
int  p,
int  n,
double *  a,
int  lda,
double *  b,
int  ldb,
double  tola,
double  tolb,
int *  k,
int *  l,
double *  u,
int  ldu,
double *  v,
int  ldv,
double *  q,
int  ldq,
int *  iwork,
double *  tau,
double *  work 
)

Purpose

DGGSVP computes orthogonal matrices U, V and Q such that

             N-K-L  K    L

U'*A*Q = K ( 0 A12 A13 ) if M-K-L >= 0; L ( 0 0 A23 ) M-K-L ( 0 0 0 )

   N-K-L  K    L

= K ( 0 A12 A13 ) if M-K-L < 0; M-K ( 0 0 A23 )

N-K-L K L V'*B*Q = L ( 0 0 B13 ) P-L ( 0 0 0 )

where the K-by-K matrix A12 and L-by-L matrix B13 are nonsingular upper triangular; A23 is L-by-L upper triangular if M-K-L >= 0, otherwise A23 is (M-K)-by-L upper trapezoidal. K+L = the effective numerical rank of the (M+P)-by-N matrix (A',B')'. Z' denotes the transpose of Z.

This decomposition is the preprocessing step for computing the Generalized Singular Value Decomposition (GSVD), see subroutine DGGSVD.

Arguments

JOBU (input) CHARACTER*1 = 'U': Orthogonal matrix U is computed; = 'N': U is not computed.

JOBV (input) CHARACTER*1 = 'V': Orthogonal matrix V is computed; = 'N': V is not computed.

JOBQ (input) CHARACTER*1 = 'Q': Orthogonal matrix Q is computed; = 'N': Q is not computed.

M (input) INTEGER The number of rows of the matrix A. M >= 0.

P (input) INTEGER The number of rows of the matrix B. P >= 0.

N (input) INTEGER The number of columns of the matrices A and B. N >= 0.

A (input/output) DOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit, A contains the triangular (or trapezoidal) matrix described in the Purpose section.

LDA (input) INTEGER The leading dimension of the array A. LDA >= max(1,M).

B (input/output) DOUBLE PRECISION array, dimension (LDB,N) On entry, the P-by-N matrix B. On exit, B contains the triangular matrix described in the Purpose section.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,P).

TOLA (input) DOUBLE PRECISION TOLB (input) DOUBLE PRECISION TOLA and TOLB are the thresholds to determine the effective numerical rank of matrix B and a subblock of A. Generally, they are set to TOLA = MAX(M,N)*norm(A)*MAZHEPS, TOLB = MAX(P,N)*norm(B)*MAZHEPS. The size of TOLA and TOLB may affect the size of backward errors of the decomposition.

K (output) INTEGER L (output) INTEGER On exit, K and L specify the dimension of the subblocks described in Purpose. K + L = effective numerical rank of (A',B')'.

U (output) DOUBLE PRECISION array, dimension (LDU,M) If JOBU = 'U', U contains the orthogonal matrix U. If JOBU = 'N', U is not referenced.

LDU (input) INTEGER The leading dimension of the array U. LDU >= max(1,M) if JOBU = 'U'; LDU >= 1 otherwise.

V (output) DOUBLE PRECISION array, dimension (LDV,P) If JOBV = 'V', V contains the orthogonal matrix V. If JOBV = 'N', V is not referenced.

LDV (input) INTEGER The leading dimension of the array V. LDV >= max(1,P) if JOBV = 'V'; LDV >= 1 otherwise.

Q (output) DOUBLE PRECISION array, dimension (LDQ,N) If JOBQ = 'Q', Q contains the orthogonal matrix Q. If JOBQ = 'N', Q is not referenced.

LDQ (input) INTEGER The leading dimension of the array Q. LDQ >= max(1,N) if JOBQ = 'Q'; LDQ >= 1 otherwise.

IWORK (workspace) INTEGER array, dimension (N)

TAU (workspace) DOUBLE PRECISION array, dimension (N)

WORK (workspace) DOUBLE PRECISION array, dimension (max(3*N,M,P))

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value.

Further Details

The subroutine uses LAPACK subroutine DGEQPF for the QR factorization with column pivoting to detect the effective numerical rank of the a matrix. It may be replaced by a better rank determination strategy.


.. Parameters ..

int psi::C_DGTCON ( char  norm,
int  n,
double *  dl,
double *  d,
double *  du,
double *  du2,
int *  ipiv,
double  anorm,
double *  rcond,
double *  work,
int *  iwork 
)

Purpose

DGTCON estimates the reciprocal of the condition number of a real tridiagonal matrix A using the LU factorization as computed by DGTTRF.

An estimate is obtained for norm(inv(A)), and the reciprocal of the condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).

Arguments

NORM (input) CHARACTER*1 Specifies whether the 1-norm condition number or the infinity-norm condition number is required: = '1' or 'O': 1-norm; = 'I': Infinity-norm.

N (input) INTEGER The order of the matrix A. N >= 0.

DL (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) multipliers that define the matrix L from the LU factorization of A as computed by DGTTRF.

D (input) DOUBLE PRECISION array, dimension (N) The n diagonal elements of the upper triangular matrix U from the LU factorization of A.

DU (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) elements of the first superdiagonal of U.

DU2 (input) DOUBLE PRECISION array, dimension (N-2) The (n-2) elements of the second superdiagonal of U.

IPIV (input) INTEGER array, dimension (N) The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.

ANORM (input) DOUBLE PRECISION If NORM = '1' or 'O', the 1-norm of the original matrix A. If NORM = 'I', the infinity-norm of the original matrix A.

RCOND (output) DOUBLE PRECISION The reciprocal of the condition number of the matrix A, computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an estimate of the 1-norm of inv(A) computed in this routine.

WORK (workspace) DOUBLE PRECISION array, dimension (2*N)

IWORK (workspace) INTEGER array, dimension (N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value


.. Parameters ..

int psi::C_DGTRFS ( char  trans,
int  n,
int  nrhs,
double *  dl,
double *  d,
double *  du,
double *  dlf,
double *  df,
double *  duf,
double *  du2,
int *  ipiv,
double *  b,
int  ldb,
double *  x,
int  ldx,
double *  ferr,
double *  berr,
double *  work,
int *  iwork 
)

Purpose

DGTRFS improves the computed solution to a system of linear equations when the coefficient matrix is tridiagonal, and provides error bounds and backward error estimates for the solution.

Arguments

TRANS (input) CHARACTER*1 Specifies the form of the system of equations: = 'N': A * X = B (No transpose) = 'T': A**T * X = B (Transpose) = 'C': A**H * X = B (Conjugate transpose = Transpose)

N (input) INTEGER The order of the matrix A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

DL (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) subdiagonal elements of A.

D (input) DOUBLE PRECISION array, dimension (N) The diagonal elements of A.

DU (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) superdiagonal elements of A.

DLF (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) multipliers that define the matrix L from the LU factorization of A as computed by DGTTRF.

DF (input) DOUBLE PRECISION array, dimension (N) The n diagonal elements of the upper triangular matrix U from the LU factorization of A.

DUF (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) elements of the first superdiagonal of U.

DU2 (input) DOUBLE PRECISION array, dimension (N-2) The (n-2) elements of the second superdiagonal of U.

IPIV (input) INTEGER array, dimension (N) The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.

B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) The right hand side matrix B.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

X (input/output) DOUBLE PRECISION array, dimension (LDX,NRHS) On entry, the solution matrix X, as computed by DGTTRS. On exit, the improved solution matrix X.

LDX (input) INTEGER The leading dimension of the array X. LDX >= max(1,N).

FERR (output) DOUBLE PRECISION array, dimension (NRHS) The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error.

BERR (output) DOUBLE PRECISION array, dimension (NRHS) The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

WORK (workspace) DOUBLE PRECISION array, dimension (3*N)

IWORK (workspace) INTEGER array, dimension (N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value

Internal Parameters

ITMAX is the maximum number of steps of iterative refinement.


.. Parameters ..

int psi::C_DGTSV ( int  n,
int  nrhs,
double *  dl,
double *  d,
double *  du,
double *  b,
int  ldb 
)

Purpose

DGTSV solves the equation

A*X = B,

where A is an n by n tridiagonal matrix, by Gaussian elimination with partial pivoting.

Note that the equation A'*X = B may be solved by interchanging the order of the arguments DU and DL.

Arguments

N (input) INTEGER The order of the matrix A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

DL (input/output) DOUBLE PRECISION array, dimension (N-1) On entry, DL must contain the (n-1) sub-diagonal elements of A.

On exit, DL is overwritten by the (n-2) elements of the second super-diagonal of the upper triangular matrix U from the LU factorization of A, in DL(1), ..., DL(n-2).

D (input/output) DOUBLE PRECISION array, dimension (N) On entry, D must contain the diagonal elements of A.

On exit, D is overwritten by the n diagonal elements of U.

DU (input/output) DOUBLE PRECISION array, dimension (N-1) On entry, DU must contain the (n-1) super-diagonal elements of A.

On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U.

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the N by NRHS matrix of right hand side matrix B. On exit, if INFO = 0, the N by NRHS solution matrix X.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, U(i,i) is exactly zero, and the solution has not been computed. The factorization has not been completed unless i = N.


.. Parameters ..

int psi::C_DGTSVX ( char  fact,
char  trans,
int  n,
int  nrhs,
double *  dl,
double *  d,
double *  du,
double *  dlf,
double *  df,
double *  duf,
double *  du2,
int *  ipiv,
double *  b,
int  ldb,
double *  x,
int  ldx,
double *  rcond 
)

Purpose

DGTSVX uses the LU factorization to compute the solution to a real system of linear equations A * X = B or A**T * X = B, where A is a tridiagonal matrix of order N and X and B are N-by-NRHS matrices.

Error bounds on the solution and a condition estimate are also provided.

Description

The following steps are performed:

  1. If FACT = 'N', the LU decomposition is used to factor the matrix A as A = L * U, where L is a product of permutation and unit lower bidiagonal matrices and U is upper triangular with nonzeros in only the main diagonal and first two superdiagonals.
  2. If some U(i,i)=0, so that U is exactly singular, then the routine returns with INFO = i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, C++ Return value: INFO (output) INTEGER to solve for X and compute error bounds as described below.
  3. The system of equations is solved for X using the factored form of A.
  4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.

Arguments

FACT (input) CHARACTER*1 Specifies whether or not the factored form of A has been supplied on entry. = 'F': DLF, DF, DUF, DU2, and IPIV contain the factored form of A; DL, D, DU, DLF, DF, DUF, DU2 and IPIV will not be modified. = 'N': The matrix will be copied to DLF, DF, and DUF and factored.

TRANS (input) CHARACTER*1 Specifies the form of the system of equations: = 'N': A * X = B (No transpose) = 'T': A**T * X = B (Transpose) = 'C': A**H * X = B (Conjugate transpose = Transpose)

N (input) INTEGER The order of the matrix A. N >= 0.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

DL (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) subdiagonal elements of A.

D (input) DOUBLE PRECISION array, dimension (N) The n diagonal elements of A.

DU (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) superdiagonal elements of A.

DLF (input or output) DOUBLE PRECISION array, dimension (N-1) If FACT = 'F', then DLF is an input argument and on entry contains the (n-1) multipliers that define the matrix L from the LU factorization of A as computed by DGTTRF.

If FACT = 'N', then DLF is an output argument and on exit contains the (n-1) multipliers that define the matrix L from the LU factorization of A.

DF (input or output) DOUBLE PRECISION array, dimension (N) If FACT = 'F', then DF is an input argument and on entry contains the n diagonal elements of the upper triangular matrix U from the LU factorization of A.

If FACT = 'N', then DF is an output argument and on exit contains the n diagonal elements of the upper triangular matrix U from the LU factorization of A.

DUF (input or output) DOUBLE PRECISION array, dimension (N-1) If FACT = 'F', then DUF is an input argument and on entry contains the (n-1) elements of the first superdiagonal of U.

If FACT = 'N', then DUF is an output argument and on exit contains the (n-1) elements of the first superdiagonal of U.

DU2 (input or output) DOUBLE PRECISION array, dimension (N-2) If FACT = 'F', then DU2 is an input argument and on entry contains the (n-2) elements of the second superdiagonal of U.

If FACT = 'N', then DU2 is an output argument and on exit contains the (n-2) elements of the second superdiagonal of U.

IPIV (input or output) INTEGER array, dimension (N) If FACT = 'F', then IPIV is an input argument and on entry contains the pivot indices from the LU factorization of A as computed by DGTTRF.

If FACT = 'N', then IPIV is an output argument and on exit contains the pivot indices from the LU factorization of A; row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.

B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) The N-by-NRHS right hand side matrix B.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

X (output) DOUBLE PRECISION array, dimension (LDX,NRHS) If INFO = 0 or INFO = N+1, the N-by-NRHS solution matrix X.

LDX (input) INTEGER The leading dimension of the array X. LDX >= max(1,N).

RCOND (output) DOUBLE PRECISION The estimate of the reciprocal condition number of the matrix A. If RCOND is less than the machine precision (in particular, if RCOND = 0), the matrix is singular to working precision. This condition is indicated by a return code of C++ Return value: INFO (output) INTEGER

FERR (output) DOUBLE PRECISION array, dimension (NRHS) The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error.

BERR (output) DOUBLE PRECISION array, dimension (NRHS) The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

WORK (workspace) DOUBLE PRECISION array, dimension (3*N)

IWORK (workspace) INTEGER array, dimension (N)

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, and i is <= N: U(i,i) is exactly zero. The factorization has not been completed unless i = N, but the factor U is exactly singular, so the solution and error bounds could not be computed. RCOND = 0 is returned. = N+1: U is nonsingular, but RCOND is less than machine precision, meaning that the matrix is singular to working precision. Nevertheless, the solution and error bounds are computed because there are a number of situations where the computed solution can be more accurate than the value of RCOND would suggest.


.. Parameters ..

int psi::C_DGTTRF ( int  n,
double *  dl,
double *  d,
double *  du,
double *  du2,
int *  ipiv 
)

Purpose

DGTTRF computes an LU factorization of a real tridiagonal matrix A using elimination with partial pivoting and row interchanges.

The factorization has the form A = L * U where L is a product of permutation and unit lower bidiagonal matrices and U is upper triangular with nonzeros in only the main diagonal and first two superdiagonals.

Arguments

N (input) INTEGER The order of the matrix A.

DL (input/output) DOUBLE PRECISION array, dimension (N-1) On entry, DL must contain the (n-1) sub-diagonal elements of A.

On exit, DL is overwritten by the (n-1) multipliers that define the matrix L from the LU factorization of A.

D (input/output) DOUBLE PRECISION array, dimension (N) On entry, D must contain the diagonal elements of A.

On exit, D is overwritten by the n diagonal elements of the upper triangular matrix U from the LU factorization of A.

DU (input/output) DOUBLE PRECISION array, dimension (N-1) On entry, DU must contain the (n-1) super-diagonal elements of A.

On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U.

DU2 (output) DOUBLE PRECISION array, dimension (N-2) On exit, DU2 is overwritten by the (n-2) elements of the second super-diagonal of U.

IPIV (output) INTEGER array, dimension (N) The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -k, the k-th argument had an illegal value > 0: if INFO = k, U(k,k) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.


.. Parameters ..

int psi::C_DGTTRS ( char  trans,
int  n,
int  nrhs,
double *  dl,
double *  d,
double *  du,
double *  du2,
int *  ipiv,
double *  b,
int  ldb 
)

Purpose

DGTTRS solves one of the systems of equations A*X = B or A'*X = B, with a tridiagonal matrix A using the LU factorization computed by DGTTRF.

Arguments

TRANS (input) CHARACTER*1 Specifies the form of the system of equations. = 'N': A * X = B (No transpose) = 'T': A'* X = B (Transpose) = 'C': A'* X = B (Conjugate transpose = Transpose)

N (input) INTEGER The order of the matrix A.

NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

DL (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) multipliers that define the matrix L from the LU factorization of A.

D (input) DOUBLE PRECISION array, dimension (N) The n diagonal elements of the upper triangular matrix U from the LU factorization of A.

DU (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) elements of the first super-diagonal of U.

DU2 (input) DOUBLE PRECISION array, dimension (N-2) The (n-2) elements of the second super-diagonal of U.

IPIV (input) INTEGER array, dimension (N) The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.

B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the matrix of right hand side vectors B. On exit, B is overwritten by the solution vectors X.

LDB (input) INTEGER The leading dimension of the array B. LDB >= max(1,N).

C++ Return value: INFO (output) INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value


.. Local Scalars ..

int psi::C_DHGEQZ ( char  job,
char  compq,
char  compz,