선형대수45✏️ 기저와 차원, RREF 활용

Поделиться
HTML-код
  • Опубликовано: 7 янв 2025

Комментарии • 4

  • @ptostudy
    @ptostudy  4 года назад

    double non0row(matrix A);
    matrix rref(P);
    matrix.format("%4g");
    A = [ 1,1,1,1,1; 1,2,3,4,5; 2,3,4,5,6 ];
    rref(A);
    B = [ 2,5,3; -1,2,1; 1,1,1 ];
    C = rref( B | .I(3) ).ratio;
    (B * C..()(4,5,6)).trun10;
    matrix.format("");
    ///////////////////////////////////////
    // rref : reduced row echelon form
    /////////////////////////////////////////
    //-----------------------------------------------
    // non zero row
    //-----------------------------------------------
    double non0row(matrix A) {
    erow = 1;
    for(i = A.m; i >= 1; i--) {
    if( A.row(i).maxentry.abs > 1.e-6 ) { erow = i; break; }
    } 0; // meaningless but necessary
    return erow;
    } 0;; // meaningless but necessary
    //-----------------------------------------------
    // reduced row echelon form
    //-----------------------------------------------
    matrix rref(P) {
    double heps,p,pivot,opt = 2; matrix x;
    heps = 1.e-6;
    A = P;

    irow = 1;
    erow = non0row(A);
    for(k = 1; k erow) break;
    if( A.row(irow).maxentry.abs < heps ) {
    A = A.swap(irow,erow);
    --erow;
    } 0; // meaningless but necessary 0;
    if( A.col(k).maxentry.abs < heps ) continue;
    p = A(irow,k).abs;
    pivot = irow;
    for(i = irow+1; i 1 ) A.row(irow) = x;
    for(i = 1; i

    • @ptostudy
      @ptostudy  4 года назад

      double non0row(matrix A);
      matrix rref(P);
      matrix.format("%4g");
      A = [ 1,1,1,1,1; 1,2,3,4,5; 2,3,4,5,6 ];
      rref(A); matrix.format("");
      ///////////////////////////////////////
      // rref : reduced row echelon form
      /////////////////////////////////////////
      //-----------------------------------------------
      // non zero row
      //-----------------------------------------------
      double non0row(matrix A) {
      erow = 1;
      for(i = A.m; i >= 1; i--) {
      if( A.row(i).maxentry.abs > 1.e-6 ) { erow = i; break; }
      } 0; // meaningless but necessary
      return erow;
      } 0;; // meaningless but necessary
      //-----------------------------------------------
      // reduced row echelon form
      //-----------------------------------------------
      matrix rref(P) {
      double heps,p,pivot,opt = 2; matrix x;
      heps = 1.e-6;
      A = P;

      irow = 1;
      erow = non0row(A);
      for(k = 1; k erow) break;
      if( A.row(irow).maxentry.abs < heps ) {
      A = A.swap(irow,erow);
      --erow;
      } 0; // meaningless but necessary 0;
      if( A.col(k).maxentry.abs < heps ) continue;
      p = A(irow,k).abs;
      pivot = irow;
      for(i = irow+1; i 1 ) A.row(irow) = x;
      for(i = 1; i

  • @keideepti6685
    @keideepti6685 4 года назад

    감사합니다.

    • @ptostudy
      @ptostudy  4 года назад

      댓글 감사합니다