[BACK]Return to lineq-4.rtf CVS log [TXT][DIR] Up to [local] / OpenXM / src / cfep / tests

Annotation of OpenXM/src/cfep/tests/lineq-4.rtf, Revision 1.1

1.1     ! takayama    1: {\rtf1\mac\ansicpg10001\cocoartf824\cocoasubrtf330
        !             2: {\fonttbl\f0\fswiss\fcharset77 Helvetica;\f1\fnil\fcharset78 HiraKakuPro-W3;\f2\fnil\fcharset77 Monaco;
        !             3: }
        !             4: {\colortbl;\red255\green255\blue255;\red106\green117\blue255;}
        !             5: \paperw11900\paperh16840\margl1440\margr1440\vieww14600\viewh10420\viewkind0
        !             6: \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
        !             7:
        !             8: \f0\fs24 \cf0 /*
        !             9: \f1 \'98\'41\'97\'a7\'95\'fb\'92\'f6\'8e\'ae\'82\'c9\'82\'c2\'82\'a2\'82\'c4\'82\'cc\'83\'76\'83\'8d\'83\'4f\'83\'89\'83\'80\'82\'f0\'8f\'91\'82\'a2\'82\'c4\'83\'65\'83\'58\'83\'67\'82\'c9\'82\'b7\'82\'e9
        !            10: \f0 . \
        !            11: */\
        !            12: \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
        !            13:
        !            14: \f2\fs20 \cf0 def gaussE(A,Y) \{\
        !            15:   N = size(A)[0];\
        !            16:   for (K=1; K<=N-1; K++) \{\
        !            17:     for (I=K+1; I<=N; I++) \{\
        !            18:       P = A[I-1][K-1]/A[K-1][K-1];\
        !            19:       for (J=K; J<=N; J++) \{\
        !            20:         A[I-1][J-1] = A[I-1][J-1]-P*A[K-1][J-1];\
        !            21:       \}\
        !            22:       Y[I-1] = Y[I-1]-P*Y[K-1];\
        !            23:     \} \
        !            24:     print(A); print(Y); print("----------------");\
        !            25:   \}\
        !            26: \}\
        !            27: \
        !            28: def gtest1() \{\
        !            29:   A=newmat(3,3,\cf2 [[1,-1,2],[-1,2,-3],[3,1,1]]\cf0 );\
        !            30:   Y=newvect(3,[5,-6,8]);\
        !            31:   print(A); print(Y); print("----------------");\
        !            32:   gaussE(A,Y);\
        !            33:   return [A,Y];\
        !            34: \}\
        !            35: \
        !            36: def laplacian(N) \{\
        !            37:    A = newmat(N,N);\
        !            38:    for (I=0; I<N; I++) \{\
        !            39:         if (I > 0) A[I][I-1] = 1;\
        !            40:        A[I][I] = -2;\
        !            41:           if  (l < N-1) A[I][I+1] = 1;\
        !            42:    \}\
        !            43:    return A;\
        !            44: \}\
        !            45: [gtest1(), laplacian(3)];\
        !            46: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>