Go to the SVN repository for this file.
45mat = (
double**)
calloc(nrows,
sizeof(
double*));
47mat[0] = (
double*)
malloc((
size_t) nrows *
48(size_t) ncols *
sizeof(
double));
49 if(mat[0] !=
NULL) {
50 for(
i= 1;
i< nrows;
i++) {
51mat[
i] = &mat[0][
i* ncols];
70nelts = ((size_t)
n* (
n+ 1))/2;
72L = (
double**)
calloc(
n,
sizeof(
double*));
74L[0] = (
double*)
malloc(nelts *
sizeof(
double));
76 for(
i= 1;
i<
n;
i++) {
77L[
i] = L[
i- 1] +
i;
106mat = (
int**)
calloc(nrows,
sizeof(
int*));
108mat[0] = (
int*)
malloc((
size_t) nrows *
109(size_t) ncols *
sizeof(
int));
110 if(mat[0] !=
NULL) {
111 for(
i= 1;
i< nrows;
i++) {
112mat[
i] = &mat[0][
i* ncols];
143 for(
i= 0;
i<
n;
i++) {
144 for(j = 0; j <
i; j++) {
146 for(k = 0; k < j; k++) {
147temp -=
A[
i][k] *
A[j][k];
149 A[
i][j] = temp/
A[j][j];
152 for(k = 0; k <
i; k++) {
153temp -=
A[
i][k] *
A[
i][k];
155 A[
i][
i] = sqrt(temp);
171 for(
i= 0;
i<
n;
i++) {
173 for(j = 0; j <
i; j++) {
174temp -= L[
i][j] * x[j];
176x[
i] = temp/L[
i][
i];
179 for(j =
n- 1; j >= 0; j--) {
181 for(
i= 0;
i< j;
i++) {
182x[
i] -= L[j][
i] * x[j];
197 for(
i= 0;
i<
n;
i++) {
199 doubleabsvi =
fabs(v[
i]);
201sum = 1.0 + sum * (scale/absvi) * (scale/absvi);
204sum += (absvi/scale) * (absvi/scale);
208 returnscale * sqrt(sum);
217 for(
i= 0;
i<
n;
i++) {
218y[
i] += alpha * x[
i];
230 for(
i= 0;
i<
n;
i++) {
233alpha_i = -x[
i] / step_x[
i];
234 if(alpha_i >= 0 && alpha_i < alpha) {
Type and macro definitions from C toolkit that are not defined in C++ toolkit.
double ** Nlm_DenseMatrixNew(int nrows, int ncols)
Create and return a new, dense matrix.
void Nlm_DenseMatrixFree(double ***mat)
Free a matrix created by Nlm_DenseMatrixNew or Nlm_LtriangMatrixNew.
double Nlm_EuclideanNorm(const double v[], int n)
Compute the Euclidean norm (2-norm) of a vector.
void Nlm_SolveLtriangPosDef(double x[], int n, double **L)
Solve the linear system , where L is a non-singular lower triangular matrix, usually computed using t...
void Nlm_FactorLtriangPosDef(double **A, int n)
Accessing only the lower triangular elements of the symmetric, positive definite matrix A,...
void Nlm_AddVectors(double y[], int n, double alpha, const double x[])
Let y = y + alpha * x.
void Nlm_Int4MatrixFree(int ***mat)
Free a matrix created by Nlm_DenseMatrixNew or Nlm_LtriangMatrixNew.
double ** Nlm_LtriangMatrixNew(int n)
Create and return a new, dense, lower-triangular matrix.
int ** Nlm_Int4MatrixNew(int nrows, int ncols)
Create and return a new Int4 matrix.
double Nlm_StepBound(const double x[], int n, const double step_x[], double max)
Given a nonnegative vector x and a nonnegative scalar max, returns the largest value in [0,...
Declarations for several linear algebra routines.
voidp calloc(uInt items, uInt size)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4