BCLS: Bound Constrained Least Squares

Version 0.1

bclsqr.c File Reference

#include <cblas.h>
#include <string.h>
#include <stdio.h>
#include "bcls.h"
#include "bclib.h"
#include "bclsqr.h"
#include "lsqr.h"

Include dependency graph for bclsqr.c:

Go to the source code of this file.

Functions

static void aprod_free_lsqr (const int mode, const int mSubProb, const int nFree, double dxFree[], double y[], void *UsrWrk)
 Mat-vec routine called by LSQR.
int bcls_newton_step_lsqr (BCLS *ls, int m, int nFree, int ix[], double damp, int itnLim, double tol, double dxFree[], double x[], double c[], double r[], int *itns, double *opt)
 Compute a Newton step using LSQR.


Detailed Description

Interface to LSQR routine. Used to compute a Newton step.

Definition in file bclsqr.c.


Function Documentation

static void aprod_free_lsqr ( const int  mode,
const int  mSubProb,
const int  nFree,
double  dxFree[],
double  y[],
void *  UsrWrk 
) [static]

Mat-vec routine called by LSQR.

LSQR calls this routine, which in turn calls bcls_aprod: This routine is declared "static" so that it won't be confused with the user's own Aprod routine.

Note that mSubProb is the number of rows in the subproblem. This may or may not be equal to m, which is the number of rows in the original problem. If the subproblem is damped (because the user has either provided a linear term or an explicit damping parameter), then mSubProb = m + nFree. Otherwise, mSubProb = m.

Parameters:
[in] mode Determines which producte with A is required.
[in] mSubProb Number of rows in the matrix seen by LSQR. Also:
  • length of y.
[in] nFree Number of columns in A(:,ix). Also:
  • length of ix
  • length of dxFree.
[in,out] dxFree Primal variables
[in,out] y Dual variables.
[in,out] UsrWrk Transit pointer to the BCLS problem context.

Definition at line 79 of file bclsqr.c.

References bcls_aprod(), BCLS_PRECON_U, BCLS_PRECON_Ut, BCLS_PROD_A, BCLS_PROD_At, bcls_usolve(), cblas_daxpy(), cblas_dcopy(), BCLS::damp_actual, BCLS::dx, BCLS::ix, BCLS::m, BCLS::Usolve, and BCLS::wrk_u.

Referenced by bcls_newton_step_lsqr().

Here is the call graph for this function:

int bcls_newton_step_lsqr ( BCLS ls,
int  m,
int  nFree,
int  ix[],
double  damp,
int  itnLim,
double  tol,
double  dxFree[],
double  x[],
double  c[],
double  r[],
int *  itns,
double *  opt 
)

Compute a Newton step using LSQR.

See also:
bcls_newton_step_cgls.
Parameters:
[in,out] ls BCLS problem context.
[in] m Number of rows in A.
[in] nFree Number of columns in A(:,ix). Also:
  • length of ix and dxFree
[in] ix Index of free variables.
[in] damp Regularization parameter.
[in] itnLim Iteration limit on current LSQR call.
[in] tol LSQR's atol and btol.
[in,out] dxFree Search direction on free variables.
[in,out] x Current point.
[in] c Linear term.
[in,out] r Residual. Used as RHS for LSQR.
[out] itns Number of LSQR iterations on current subproblem.
[out] opt Optimality achieved by LSQR on current subproblem.
Returns:
  • 0: Required accurace was achieved.
  • 1: The iteration limit (itnLim) was reached.
  • 2: A(:,ix) is excessively ill-conditioned.

Definition at line 168 of file bclsqr.c.

References aprod_free_lsqr(), bcls_timer(), BCLS_TIMER_LSQR, BCLS_TIMER_START, BCLS_TIMER_STOP, cblas_dscal(), BCLS::damp_actual, BCLS::damp_min, lsqr(), BCLS::stopwatch, and BCLS::wrk_v.

Referenced by bcls_newton_step().

Here is the call graph for this function:

Generated on Sun Mar 4 22:50:03 2007 by Doxygen 1.5.1