From 176562f088709675f2f630b9c4a5110228eacb1c Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Fri, 30 Oct 2026 21:56:04 +0100 Subject: [PATCH] comment corrections --- davidson.h | 2 +- diis.h | 2 +- mat.cc | 4 ++-- mat.h | 4 ++-- optimize.cc | 4 ++++ optimize.h | 1 + 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/davidson.h b/davidson.h index 3594705..0283b61 100644 --- a/davidson.h +++ b/davidson.h @@ -42,7 +42,7 @@ namespace LA { //@@@implement start from larger Krylov space than a single vector - useful for multiroot solutions -//Davidson algorithm: J. Comp. Phys. 17:817 (1975) +//Davidson algorithm: J. Comput. Phys. 17, 87 (1975) template diff --git a/diis.h b/diis.h index 633fc57..0a446b8 100644 --- a/diis.h +++ b/diis.h @@ -57,7 +57,7 @@ public: ~DIIS(); DIIS(const DIIS &) = delete; //owns raw storage, not copyable DIIS & operator=(const DIIS &) = delete; - typename LA_traits::normtype extrapolate(T &vec, U &errvec, bool verbose=false, const Un diiseps=0, bool errvecout=false); //vec is input/output, errvec optionally too; returns square residual norm + typename LA_traits::normtype extrapolate(T &vec, U &errvec, bool verbose=false, const Un diiseps=0, bool errvecout=false); //vec is input/output, errvec optionally too; returns the norm of the input errvec (1 in the first call) }; template diff --git a/mat.cc b/mat.cc index cff0d66..2bddc57 100644 --- a/mat.cc +++ b/mat.cc @@ -1402,7 +1402,7 @@ const NRSMat NRMat::timestransposed() const { /***************************************************************************//** * fill given real matrix with random numbers - * @param[in] x generate random numbers from the interval [0, x] + * @param[in] x generate random numbers from the interval [-x, x) ******************************************************************************/ template<> void NRMat::randomize(const double &x) { @@ -1432,7 +1432,7 @@ void NRMat::randomize(const double &x) { /***************************************************************************//** * fill given complex matrix with random numbers * real/imaginary components are generated independently - * @param[in] x generate random numbers from the interval [0, x] + * @param[in] x generate random numbers from the interval [-x, x) ******************************************************************************/ template<> void NRMat >::randomize(const double &x) { diff --git a/mat.h b/mat.h index 95fbcff..06c96fb 100644 --- a/mat.h +++ b/mat.h @@ -207,9 +207,9 @@ public: //! unary minus const NRMat operator-() const; - //! add scalar value to all matrix elements and return the result by value + //! add scalar value to the diagonal elements and return the result by value inline const NRMat operator+(const T &a) const; - //! subtract scalar value from all matrix elements and return the result by value + //! subtract scalar value from the diagonal elements and return the result by value inline const NRMat operator-(const T &a) const; //! multiply all matrix elements by a scalar value and return the result by value inline const NRMat operator*(const T &a) const; diff --git a/optimize.cc b/optimize.cc index 63681af..ebb5a6b 100644 --- a/optimize.cc +++ b/optimize.cc @@ -1,6 +1,7 @@ /* LA: linear algebra C++ interface library Copyright (C) 2026 Jiri Pittner or + This code has been prepared with the assistance of an AI (Claude Opus 5.5, Anthropic). This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2074,6 +2075,9 @@ template class QNG_Optimizer; \ template class Adam_Optimizer; \ template class SPSA_Optimizer; \ template T linemin_brent(optevaluator &e, NRVec &x, T &f, const NRVec &u, const T t1, const T tol, const T abstol, const int maxiter, const int verbose); \ +template optresult linesearch_minimize(const char *name, linesearch_direction &dir, const OptProblem *o, NRVec &x, const linesearch_hyperparameters &hp, hyperparameters *achieved); \ +template optresult firstorder_minimize(const char *name, firstorder_step &stepper, const OptProblem *o, NRVec &x, const firstorder_hyperparameters &hp, hyperparameters *achieved, gradient_estimator *est); \ +template optresult trustregion_minimize(const char *name, trustregion_step &stepper, const OptProblem *o, NRVec &x, const trustregion_hyperparameters &hp, hyperparameters *achieved); \ INSTANTIZE(double) diff --git a/optimize.h b/optimize.h index 463b8ea..94d3d12 100644 --- a/optimize.h +++ b/optimize.h @@ -1,6 +1,7 @@ /* LA: linear algebra C++ interface library Copyright (C) 2021 Jiri Pittner or + This code has been prepared with the assistance of an AI (Claude Opus 5.5, Anthropic). This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by