Package com.mockturtlesolutions.snifflib.datatypes

Examples of com.mockturtlesolutions.snifflib.datatypes.DblMatrix


//    
//   }
 
  public void add(BufferStorage temp,double concentration)
  {
    this.add(temp,new DblMatrix(concentration));
  }
View Full Code Here


    this.add(temp,new DblMatrix(concentration));
  }
 
  public void add(String buffername,double concentration)
  {
    this.add(buffername,new DblMatrix(concentration));
  }
View Full Code Here

    BufferSolution testSol = new BufferSolution();
    testSol.setConnection(this.connection);
    testSol.setRepository(this.repos);
   
    //Create a 1mM solution of the buffer in question (concentration is arbitrary.
    testSol.add(buffername,new DblMatrix(0.001));
    //To contain an equivalent we require that what ever the component in
    //testSol is in this solution too.
    //HashMap contents = testSol.getContents();
    //Set keys = contents.keySet();
    //Iterator iter = keys.iterator();
View Full Code Here

    String nickname = temp.getNickname();
   
    if (this.contains(nickname))//The buffer being added is a simple buffer already in this buffer.
    {
      //System.out.println("Increasing already in there");
      DblMatrix current = this.getConcentration(nickname);
     
      current = current.plus(concentration);
      this.setConcentration(nickname,current);
    }
    else
    {
   
      BufferSolution testSol = new BufferSolution();
      testSol.setConnection(this.connection);
      testSol.setRepository(this.repos);

      //Create a solution of the buffer in question.
      testSol.add(temp,new DblMatrix(concentration));

      //HashMap contents = testSol.getContents();
      //Set keys = contents.keySet();
      //Iterator iter = keys.iterator();
     
      String[] contents = testSol.getComponents();

      boolean out = true;
      //while (iter.hasNext())
      for (int j=0;j<contents.length;j++)
      {
        String comp = contents[j];
        //String comp = (String)iter.next();
        //DblMatrix current = (DblMatrix)this.concentrationMap.get(comp);
        if (this.summaryBuffer.hasComponent(comp))
        {
          DblMatrix current = this.summaryBuffer.getEstimatedConcentration(comp);
          if (current == null)
          {
            this.add(comp,testSol.getConcentration(comp));
          }
          else
          {
            current = current.plus(testSol.getConcentration(comp));
          }
        }
        else
        {
          this.add(comp,testSol.getConcentration(comp));
View Full Code Here

 
 
    if (this.contains(buffername))//The buffer being added is a simple buffer already in this buffer.
    {
      //System.out.println("Increasing already in there");
      DblMatrix current = this.getConcentration(buffername);
     
      current = current.plus(concentration);
      this.setConcentration(buffername,current);
    }
    else
    {
      BufferSolution testSol = new BufferSolution();
      testSol.setConnection(this.connection);
      testSol.setRepository(this.repos);
      testSol.initialize();
     
      //Create a solution of the buffer in question
      testSol.add(buffername,new DblMatrix(concentration));

      //HashMap contents = testSol.getContents();
      //Set keys = contents.keySet();
      //Iterator iter = keys.iterator();
     
      String[] contents = testSol.getComponents();

      boolean out = true;
      //while (iter.hasNext())
      for (int j=0;j<contents.length;j++)
      {
        String comp = contents[j];
        //String comp = (String)iter.next();
        //DblMatrix current = (DblMatrix)this.concentrationMap.get(comp);
        if (this.summaryBuffer.hasComponent(comp))
        {
          DblMatrix current = this.summaryBuffer.getEstimatedConcentration(comp);
          if (current == null)
          {
            this.add(comp,testSol.getConcentration(comp));
          }
          else
          {
            current = current.plus(testSol.getConcentration(comp));
          }
        }
        else
        {
          this.add(comp,testSol.getConcentration(comp));
View Full Code Here

    BufferSolution testSol = new BufferSolution();
    testSol.setConnection(this.connection);
    testSol.setRepository(this.repos);
   
    //Create a  solution of the buffer in question
    testSol.add(buffername,new DblMatrix(concentration));
   
    //HashMap contents = testSol.getContents();
    //Set keys = contents.keySet();
    //Iterator iter = keys.iterator();
   
    String[] contents = testSol.getComponents();
   
    boolean out = true;
    //while (iter.hasNext())
   
    for (int j=0;j<contents.length;j++)
    {
   
      //String comp = (String)iter.next();
      String comp = contents[j];
      //DblMatrix current = (DblMatrix)this.concentrationMap.get(comp);
     
      DblMatrix current = this.summaryBuffer.getEstimatedConcentration(comp);
      if (current == null)
      {
        this.add(comp,(testSol.getConcentration(comp)).times(-1));
      }
      else
      {
        current = current.minus(testSol.getConcentration(comp));
      }
    }
  }
View Full Code Here

    BufferSolution testSol = new BufferSolution();
    testSol.setConnection(this.connection);
    testSol.setRepository(this.repos);
   
    //Create a solution of the buffer in question (concentration is arbitrary.
    testSol.add(temp,new DblMatrix(concentration));
   
    //HashMap contents = testSol.getContents();
    //Set keys = contents.keySet();
    //Iterator iter = keys.iterator();
    String[] contents = testSol.getComponents();
   
    boolean out = true;
    //while (iter.hasNext())
   
    for (int j=0;j<contents.length;j++)
    {
      //String comp = (String)iter.next();
      String comp = contents[j];
      //DblMatrix current = (DblMatrix)this.concentrationMap.get(comp);
     
      DblMatrix current = this.summaryBuffer.getEstimatedConcentration(comp);
      if (current == null)
      {
        this.add(comp,(testSol.getConcentration(comp)).times(-1));
      }
      else
      {
        current = current.minus(testSol.getConcentration(comp));
      }
    }
  }
View Full Code Here

    String[] contents;
   
    //Iterator iter2;
    Set components;
    String comp;
    DblMatrix conc,incrconc;
    String sname;
   
    for (int j=0;j<buffers.size();j++)
    {
      sol = (BufferSolution)buffers.get(j);
      factor = (Double)factors.get(j);
     
      contents = sol.getComponents();   
      //contents = sol.getContents();
      //components = contents.keySet();
      //iter2 = components.iterator();//Get that solution's buffer components.
     
      //while (iter2.hasNext())
      for (int i=0;i<contents.length;i++)
      {
        //comp = (String)iter2.next();
        comp = contents[i];
        //conc = (DblMatrix)contents.get(comp);
        conc = sol.getConcentration(comp);
       
        incrconc = (conc.times(factor)).divideBy(sumOfFactors);
        newSol.increase(comp,incrconc.getDoubleAt(0).doubleValue());
      }
    }
   
    return(newSol);
View Full Code Here

    //Iterator iter2;
    //Set components;
   
    String[] contents;
    String comp;
    DblMatrix conc,incrconc;
    String sname;
   
    for (int j=0;j<buffers.size();j++)
    {
      sol = (BufferSolution)buffers.get(j);
      factor = (Double)factors.getDoubleAt(j);
         
      //contents = sol.getContents();
      contents = sol.getComponents();
     
      //components = contents.keySet();
      //iter2 = components.iterator();//Get that solution's buffer components.
      //while (iter2.hasNext())
      for (int i=0;i<contents.length;i++)
      {
        //comp = (String)iter2.next();
        comp = contents[i];
        //conc = (DblMatrix)contents.get(comp);
        conc = sol.getConcentration(comp);
        incrconc = (conc.times(factor)).divideBy(sumOfFactors);
        newSol.increase(comp,incrconc.getDoubleAt(0).doubleValue());
      }
    }
   
    return(newSol);
View Full Code Here

  Predicts moles of base added for the standard range of pH values.
  The standard range of pH values is an array of 25 values from 2 to 12.
  */
  public HashMap Cb()
  {
    DblMatrix pH = DblMatrix.span(2,12,25);
    HashMap out = null;
    out.put("com.mockturtlesolutions.water",DblMatrix.span(2,12,25));
    out.put("com.mockturtlesolutions.Lactic",DblMatrix.span(2,12,25));
    //out=this.CbMethod.Cb(pH);
   
View Full Code Here

TOP

Related Classes of com.mockturtlesolutions.snifflib.datatypes.DblMatrix

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.