Package Jama

Examples of Jama.Matrix


    PowerControlledCC cancellationCarrier = new PowerControlledCC(allCarriers, cancellationCarriers);   
   
    int usedSize = allCarriers-cancellationCarriers.size();
   
    for (int maxDegrees = 0; maxDegrees < cancellationCarriers.size(); maxDegrees++) {
      Matrix displayMatrix = new Matrix(usedSize, allCarriers);
      for (int basisVector = 0; basisVector < usedSize; basisVector++) {
        double[] usedData = new double[usedSize];
        usedData[basisVector] = 1;
        double[] allData = cancellationCarrier.getAssembledValuesMaxDegrees(usedData, maxDegrees);
        for (int i = 0; i < allCarriers; i++) {
          displayMatrix.set(basisVector, i, allData[i])
        }
      }
      System.out.println("Display Matrix");
      displayMatrix.print(15, 5);

      PdfGenerator.generatePDF(
          "CancellationCarrier_" + allCarriers + "used_" + cancellationCarriers.size() + "cc_" + maxDegrees + "degrees.pdf",
          displayMatrix,
          "Cancellation Carrier",
View Full Code Here


  }
      }

      // solve H d = -g, evaluate error at new location
      //double[] d = DoubleMatrix.solve(H, g);
      double[] d = (new Matrix(H)).lu().solve(new Matrix(g, nparm)).getRowPackedCopy();
      //double[] na = DoubleVector.add(a, d);
      double[] na = (new Matrix(a, nparm)).plus(new Matrix(d, nparm)).getRowPackedCopy();
      double e1 = chiSquared(x, na, y, s, f);

      if (verbose > 0) {
  System.out.println("\n\niteration "+iter+" lambda = "+lambda);
  System.out.print("a = ");
        (new Matrix(a, nparm)).print(10, 2);
  if (verbose > 1) {
          System.out.print("H = ");
          (new Matrix(H)).print(10, 2);
          System.out.print("g = ");
          (new Matrix(g, nparm)).print(10, 2);
          System.out.print("d = ");
          (new Matrix(d, nparm)).print(10, 2);
  }
  System.out.print("e0 = " + e0 + ": ");
  System.out.print("moved from ");
        (new Matrix(a, nparm)).print(10, 2);
  System.out.print("e1 = " + e1 + ": ");
  if (e1 < e0) {
    System.out.print("to ");
          (new Matrix(na, nparm)).print(10, 2);
  }
  else {
    System.out.println("move rejected");
  }
      }
View Full Code Here

      System.err.println("Exception caught: " + ex.getMessage());
      System.exit(1);
    }

    System.out.print("desired solution ");
    (new Matrix(areal, areal.length)).print(10, 2);

    System.exit(0);
  } //main
View Full Code Here

    s[i] = 1.;
    i++;
  }
      }
      System.out.print("quad x= ");
      (new Matrix(x)).print(10, 2);

      System.out.print("quad y= ");
      (new Matrix(y,npts)).print(10, 2);


      o[0] = x;
      o[1] = a;
      o[2] = y;
View Full Code Here

  }
 
  @Override
  public void invert() throws LMAMatrix.InvertException {
    try {
      Matrix m = inverse();
      setMatrix(0, this.getRowDimension() - 1, 0, getColumnDimension() - 1, m);
    }
    catch (RuntimeException e) {
      StringWriter s = new StringWriter();
      PrintWriter p = new PrintWriter(s);
View Full Code Here

      return false;
    }

    final SlicingTransform t1t2 = t1.concatenate( t2 );

    final Matrix mt1 = new Matrix( t1.getMatrix() );
    final Matrix mt2 = new Matrix( t2.getMatrix() );
    final Matrix mt1t2 = new Matrix( t1t2.getMatrix() );

    if ( mt1.times( mt2 ).minus( mt1t2 ).normF() > 0.1 )
    {
      System.out.println( "=======================" );
      System.out.println( "t1: " + t1.numSourceDimensions() + " -> " + t1.numTargetDimensions() + " (n -> m)" );
      System.out.println( "t2: " + t2.numSourceDimensions() + " -> " + t2.numTargetDimensions() + " (n -> m)" );
      System.out.println( "t1t2: " + t1t2.numSourceDimensions() + " -> " + t1t2.numTargetDimensions() + " (n -> m)" );

      System.out.print( "t1 = " );
      mt1.print( 1, 0 );
      System.out.print( "t2 = " );
      mt2.print( 1, 0 );
      System.out.print( "t1t2 = " );
      mt1t2.print( 1, 0 );
      System.out.print( "t1 x t2 = " );
      mt1.times( mt2 ).print( 1, 0 );

      System.out.println( "wrong result" );
      System.out.println( "=======================" );
View Full Code Here

      return false;
    }

    final SlicingTransform t1t2 = t2.preConcatenate( t1 );

    final Matrix mt1 = new Matrix( t1.getMatrix() );
    final Matrix mt2 = new Matrix( t2.getMatrix() );
    final Matrix mt1t2 = new Matrix( t1t2.getMatrix() );

    if ( mt1.times( mt2 ).minus( mt1t2 ).normF() > 0.1 )
    {
      System.out.println( "=======================" );
      System.out.println( "t1: " + t1.numSourceDimensions() + " -> " + t1.numTargetDimensions() + " (n -> m)" );
      System.out.println( "t2: " + t2.numSourceDimensions() + " -> " + t2.numTargetDimensions() + " (n -> m)" );
      System.out.println( "t1t2: " + t1t2.numSourceDimensions() + " -> " + t1t2.numTargetDimensions() + " (n -> m)" );

      System.out.print( "t1 = " );
      mt1.print( 1, 0 );
      System.out.print( "t2 = " );
      mt2.print( 1, 0 );
      System.out.print( "t1t2 = " );
      mt1t2.print( 1, 0 );
      System.out.print( "t1 x t2 = " );
      mt1.times( mt2 ).print( 1, 0 );

      System.out.println( "wrong result" );
      System.out.println( "=======================" );
View Full Code Here

      return false;
    }

    final MixedTransform t1t2 = t1.concatenate( t2 );

    final Matrix mt1 = new Matrix( t1.getMatrix() );
    final Matrix mt2 = new Matrix( t2.getMatrix() );
    final Matrix mt1t2 = new Matrix( t1t2.getMatrix() );

    if ( mt1.times( mt2 ).minus( mt1t2 ).normF() > 0.1 )
    {
      System.out.println( "=======================" );
      System.out.println( "t1: " + t1.numSourceDimensions() + " -> " + t1.numTargetDimensions() + " (n -> m)" );
      System.out.println( "t2: " + t2.numSourceDimensions() + " -> " + t2.numTargetDimensions() + " (n -> m)" );
      System.out.println( "t1t2: " + t1t2.numSourceDimensions() + " -> " + t1t2.numTargetDimensions() + " (n -> m)" );

      System.out.print( "t1 = " );
      mt1.print( 1, 0 );
      System.out.print( "t2 = " );
      mt2.print( 1, 0 );
      System.out.print( "t1t2 = " );
      mt1t2.print( 1, 0 );
      System.out.print( "t1 x t2 = " );
      mt1.times( mt2 ).print( 1, 0 );

      System.out.println( "wrong result" );
      System.out.println( "=======================" );
View Full Code Here

      return false;
    }

    final MixedTransform t1t2 = t2.preConcatenate( t1 );

    final Matrix mt1 = new Matrix( t1.getMatrix() );
    final Matrix mt2 = new Matrix( t2.getMatrix() );
    final Matrix mt1t2 = new Matrix( t1t2.getMatrix() );

    if ( mt1.times( mt2 ).minus( mt1t2 ).normF() > 0.1 )
    {
      System.out.println( "=======================" );
      System.out.println( "t1: " + t1.numSourceDimensions() + " -> " + t1.numTargetDimensions() + " (n -> m)" );
      System.out.println( "t2: " + t2.numSourceDimensions() + " -> " + t2.numTargetDimensions() + " (n -> m)" );
      System.out.println( "t1t2: " + t1t2.numSourceDimensions() + " -> " + t1t2.numTargetDimensions() + " (n -> m)" );

      System.out.print( "t1 = " );
      mt1.print( 1, 0 );
      System.out.print( "t2 = " );
      mt2.print( 1, 0 );
      System.out.print( "t1t2 = " );
      mt1t2.print( 1, 0 );
      System.out.print( "t1 x t2 = " );
      mt1.times( mt2 ).print( 1, 0 );

      System.out.println( "wrong result" );
      System.out.println( "=======================" );
View Full Code Here

  public static void main( final String[] args )
  {
    final MixedTransformConcatenateTest test = new MixedTransformConcatenateTest();
    test.setUp();

    final Matrix m_tr1 = new Matrix( test.tr1.getMatrix() );
    final Matrix m_tr2 = new Matrix( test.tr2.getMatrix() );
    final Matrix m_perm1 = new Matrix( test.perm1.getMatrix() );
    final Matrix m_rot1 = new Matrix( test.rot1.getMatrix() );
    final Matrix m_proj1 = new Matrix( test.proj1.getMatrix() );
    final Matrix m_proj2 = new Matrix( test.proj2.getMatrix() );
    final Matrix m_comp1 = new Matrix( test.comp1.getMatrix() );
    final Matrix m_slicing1 = new Matrix( test.slicing1.getMatrix() );

    System.out.print( "tr1 = " );
    m_tr1.print( 1, 0 );

    System.out.print( "tr2 = " );
    m_tr2.print( 1, 0 );

    System.out.print( "perm1 = " );
    m_perm1.print( 1, 0 );

    System.out.print( "rot1 = " );
    m_rot1.print( 1, 0 );

    System.out.print( "proj1 = " );
    m_proj1.print( 1, 0 );

    System.out.print( "proj2 = " );
    m_proj2.print( 1, 0 );

    System.out.print( "comp1 = " );
    m_comp1.print( 1, 0 );

    System.out.print( "m_slicing1 = " );
    m_slicing1.print( 1, 0 );
  }
View Full Code Here

TOP

Related Classes of Jama.Matrix

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.