📄 atamult.c
字号:
/*
* MATLAB Compiler: 2.0.1
* Date: Tue May 08 21:28:16 2001
* Arguments: "-B" "sgl" "-m" "-W" "mainhg" "-L" "C" "asufit.m" "absfun.m"
* "absfunfree.m" "absfunshift.m" "absfunwidth.m" "dispfit.m" "dispfitdisp.m"
* "dispfitfree.m" "dispfitwidth.m" "seqmodfree.m" "spcfun.m" "spcfun1.m"
* "atamult.m" "aprecon.m"
*/
#include "atamult.h"
/*
* The function "Matamult" is the implementation version of the "atamult"
* M-function from file "C:\MATLABR11\toolbox\optim\atamult.m" (lines 1-27). It
* contains the actual compiled code for that M-function. It is a static
* function and must only be called from one of the interface functions,
* appearing below.
*/
/*
* function[V] = atamult(Y,A,dummy,flag);
*/
static mxArray * Matamult(int nargout_,
mxArray * Y,
mxArray * A,
mxArray * dummy,
mxArray * flag) {
mxArray * V = mclGetUninitializedArray();
mxArray * nargin_ = mclGetUninitializedArray();
mlfAssign(&nargin_, mlfNargin(0, Y, A, dummy, flag, NULL));
mclValidateInputs("atamult", 4, &Y, &A, &dummy, &flag);
mclCopyArray(&flag);
/*
* %ATAMULT Example Jacobian-matrix multiply
* %
* % V = ATAMULT(Y,A) computes V = (A'*(A*Y)).
* %
* % V = ATAMULT(Y,A,dummy,flag) computes V = (A'*(A*Y)) if flag = 0,
* % V = A*Y if flag > 0,
* % V = A'*Y if flag < 0.
* % dummy is not used in this example.
* %
*
* % Copyright (c) 1990-98 by The MathWorks, Inc.
* % $Revision: 1.1 $ $Date: 1998/03/21 16:28:54 $
*
* if nargin <= 3,
*/
if (mlfTobool(mlfLe(nargin_, mlfScalar(3.0)))) {
/*
* flag = 0;
*/
mlfAssign(&flag, mlfScalar(0.0));
/*
* end
*/
}
/*
* if flag == 0
*/
if (mlfTobool(mlfEq(flag, mlfScalar(0.0)))) {
/*
* V = (A'*(A*Y));
*/
mlfAssign(&V, mlfMtimes(mlfCtranspose(A), mlfMtimes(A, Y)));
/*
* elseif flag > 0
*/
} else if (mlfTobool(mlfGt(flag, mlfScalar(0.0)))) {
/*
* V = A*Y;
*/
mlfAssign(&V, mlfMtimes(A, Y));
/*
* else
*/
} else {
/*
* V = A'*Y;
*/
mlfAssign(&V, mlfMtimes(mlfCtranspose(A), Y));
/*
* end
*/
}
mclValidateOutputs("atamult", 1, nargout_, &V);
mxDestroyArray(flag);
mxDestroyArray(nargin_);
/*
*
*
*/
return V;
}
/*
* The function "mlfAtamult" contains the normal interface for the "atamult"
* M-function from file "C:\MATLABR11\toolbox\optim\atamult.m" (lines 1-27).
* This function processes any input arguments and passes them to the
* implementation version of the function, appearing above.
*/
mxArray * mlfAtamult(mxArray * Y,
mxArray * A,
mxArray * dummy,
mxArray * flag) {
int nargout = 1;
mxArray * V = mclGetUninitializedArray();
mlfEnterNewContext(0, 4, Y, A, dummy, flag);
V = Matamult(nargout, Y, A, dummy, flag);
mlfRestorePreviousContext(0, 4, Y, A, dummy, flag);
return mlfReturnValue(V);
}
/*
* The function "mlxAtamult" contains the feval interface for the "atamult"
* M-function from file "C:\MATLABR11\toolbox\optim\atamult.m" (lines 1-27).
* The feval function calls the implementation version of atamult through this
* function. This function processes any input arguments and passes them to the
* implementation version of the function, appearing above.
*/
void mlxAtamult(int nlhs, mxArray * plhs[], int nrhs, mxArray * prhs[]) {
mxArray * mprhs[4];
mxArray * mplhs[1];
int i;
if (nlhs > 1) {
mlfError(
mxCreateString(
"Run-time Error: File: atamult Line: 1 Column: "
"0 The function \"atamult\" was called with mor"
"e than the declared number of outputs (1)"));
}
if (nrhs > 4) {
mlfError(
mxCreateString(
"Run-time Error: File: atamult Line: 1 Column:"
" 0 The function \"atamult\" was called with m"
"ore than the declared number of inputs (4)"));
}
for (i = 0; i < 1; ++i) {
mplhs[i] = NULL;
}
for (i = 0; i < 4 && i < nrhs; ++i) {
mprhs[i] = prhs[i];
}
for (; i < 4; ++i) {
mprhs[i] = NULL;
}
mlfEnterNewContext(0, 4, mprhs[0], mprhs[1], mprhs[2], mprhs[3]);
mplhs[0] = Matamult(nlhs, mprhs[0], mprhs[1], mprhs[2], mprhs[3]);
mlfRestorePreviousContext(0, 4, mprhs[0], mprhs[1], mprhs[2], mprhs[3]);
plhs[0] = mplhs[0];
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -