Package com.CompPad.model

Examples of com.CompPad.model.ComplexAmount


                    else {
                        newRow = new Double[n+1];
//                        Arrays.fill(newRow,Double.MIN_NORMAL);
                        Arrays.fill(newRow,Math.pow(2.0, -1022.0));
                        // x value
                        ComplexAmount a1 = (ComplexAmount)mmatrix.get(i,2*j);
                        // y value
                        ComplexAmount a2 = (ComplexAmount)mmatrix.get(i,2*j+1);
                        // Check whether units have been defined
                        if (xunits==null){
                            // if not then define x and y units
                            xunits = a1.getUnit();
                            yunits = a2.getUnit();

                            // get units string for system units.  These will later
                            // be assigned to x and y axes.

                            // Must get evaluator to get a units string.
                            com.CompPad.model.Evaluator evaluator
                                    = oooDocument.getCompPadDocument().getEvaluator();
                            xEvalUnit = evaluator.getUnits(a1);
                            yEvalUnit = evaluator.getUnits(a2);
                            // these units will be based on the unit system
                            // defined in the evaluator.
                           
                        }
                        else{
                            // If units have been defined, then check that the
                            // units of the current row are compatible.
                            if (!xunits.isCompatible(a1.getUnit()) || !yunits.isCompatible(a2.getUnit())){
                                throw new Exception("Inconsistant dimension in arguments to plotxy.");
                            }
                            else{
                                // otherwise, we're good.
                                // divide out by our x and y units
                                newRow[0] = a1.divide(xEvalUnit.getValue()).getReal(Unit.ONE);
                                newRow[j+1] = a2.divide(yEvalUnit.getValue()).getReal(Unit.ONE);
                                x.add(newRow);
                                mm++;
                            }

                        }
View Full Code Here

TOP

Related Classes of com.CompPad.model.ComplexAmount

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.