Class MathExt

java.lang.Object
org.jmol.scriptext.MathExt

public class MathExt extends Object
  • Field Details

  • Constructor Details

    • MathExt

      public MathExt()
  • Method Details

    • init

      public MathExt init(Object se)
    • evaluate

      public boolean evaluate(ScriptMathProcessor mp, T op, SV[] args, int tok) throws ScriptException
      Throws:
      ScriptException
    • evaluateSpacegroup

      private boolean evaluateSpacegroup(ScriptMathProcessor mp, SV[] args)
    • evaluatePointGroup

      private boolean evaluatePointGroup(ScriptMathProcessor mp, SV[] args, boolean isAtomProperty) throws ScriptException
      Throws:
      ScriptException
    • evaluateUnitCell

      private boolean evaluateUnitCell(ScriptMathProcessor mp, SV[] args, boolean isSelector) throws ScriptException
      Throws:
      ScriptException
    • evaluateArray

      private boolean evaluateArray(ScriptMathProcessor mp, SV[] args, boolean isSelector) throws ScriptException
      Throws:
      ScriptException
    • evaluateBin

      private boolean evaluateBin(ScriptMathProcessor mp, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • evaluateCache

      private boolean evaluateCache(ScriptMathProcessor mp, SV[] args)
    • evaluateColor

      private boolean evaluateColor(ScriptMathProcessor mp, SV[] args)
    • evaluateCompare

      private boolean evaluateCompare(ScriptMathProcessor mp, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • evaluateConnected

      private boolean evaluateConnected(ScriptMathProcessor mp, SV[] args, int tok, int intValue) throws ScriptException
      Throws:
      ScriptException
    • evaluateContact

      private boolean evaluateContact(ScriptMathProcessor mp, SV[] args)
    • evaluateData

      private boolean evaluateData(ScriptMathProcessor mp, SV[] args)
    • evaluateDotDist

      private boolean evaluateDotDist(ScriptMathProcessor mp, SV[] args, int tok, int op) throws ScriptException
      x = y.distance({atoms}) the average distance from elements of y to the CENTER of {atoms} x = {atomset1}.distance.min({atomset2}, asAtomSet) If asAtomSet is true, returns the closest atom in atomset1 to any atom of atomset2; if false or omitted, returns an array listing the distance of each atom in atomset1 to the closest atom in atomset2. This array can be used to assign properties to atomset1: {1.1}.property_d = {1.1}.distance.min({2.1}); color {1.1} property_d. x = {atomset1}.distance.min({point}, asAtomSet) If asAtomSet is true, returns the atom in atomset1 closest to the specified point;if false or omitted, returns the closest distance to the specified point from any atom in atomset1. x = {atomset1}.distance.min({atomset2}).min returns the shortest distance from any atom in atomset1 to any atom in atomset2. x = {atomset1}.distance.max({atomset2}, asAtomSet) If asAtomSet is true, returns the furthest atom in atomset1 to any atom of atomset2; if false or omitted, returns an array listing the distance of each atom in atomset1 to the furthest atom in atomset2. x = {atomset1}.distance.max({point}, asAtomSet) If asAtomSet is true, returns the atom in atomset1 furthest from the specified point;if false or omitted, returns the furthest distance to the specified point from any atom in atomset1. x = {atomset1}.distance.max({atomset2}).max returns the furthest distance from any atom in atomset1 to any atom in atomset2. x = {atomset1}.distance.all({atomset2}) returns an array or array of arrays of values
      Parameters:
      mp -
      args -
      tok -
      op - optional .min .max for distance
      Returns:
      true if successful
      Throws:
      ScriptException
    • evaluateHelix

      private boolean evaluateHelix(ScriptMathProcessor mp, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • getHelixData

      private Object getHelixData(javajs.util.BS bs, int tokType)
    • evaluateInChI

      private boolean evaluateInChI(ScriptMathProcessor mp, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • evaluateFind

      private boolean evaluateFind(ScriptMathProcessor mp, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • evaluateGetProperty

      private boolean evaluateGetProperty(ScriptMathProcessor mp, SV[] args, int tok0, boolean isAtomProperty) throws ScriptException
      _ by itself, not as a function, is shorthand for getProperty("auxiliaryInfo") $ print _.keys boundbox group3Counts group3Lists modelLoadNote models properties someModelsHaveFractionalCoordinates someModelsHaveSymmetry someModelsHaveUnitcells symmetryRange _m by itself, not as a function, is shorthand for getProperty("auxiliaryInfo.models")[_currentFrame] $ print format("json",_m.unitCellParams) [ 0.0,0.0,0.0,0.0,0.0,0.0,0.0,-2.1660376,-2.1660376,0.0,-2.1660376, 2.1660376,-4.10273,0.0,0.0,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN ] {atomset}._ by itself delivers a subset array of auxiliaryInfo.models for all models in {atomset} $ print {*}._..1..aflowInfo (first model's aflowInfo) _(key) prepends "auxiliaryInfo.models", delivering a modelCount-length array of information $ print _("aflowInfo[SELECT auid WHERE H__eV___VASP_ invalid input: '<' 0]") {atomset}._(key) selects for model Auxiliary info related to models of the specified atoms {atomset}.getProperty(key) defaults to atomInfo, but also allows key to start with "bondInfo" Examples: print _("aflowInfo[select sg where volume_cell > 70]") print {model>10}._("aflowInfo[select sg where volume_cell > 70]")
      Parameters:
      mp -
      args -
      tok0 -
      isAtomProperty -
      Returns:
      true if no syntax problems
      Throws:
      ScriptException
    • evaluateFormat

      private boolean evaluateFormat(ScriptMathProcessor mp, int intValue, SV[] args, boolean isLabel) throws ScriptException
      Throws:
      ScriptException
    • getSublist

      private javajs.util.Lst<SV> getSublist(javajs.util.Lst<SV> listIn, javajs.util.Lst<SV> formatList)
      [ {...},{...}... ] ==> [[...],[...]]
      Parameters:
      listIn -
      formatList -
      Returns:
      sublist
    • evaluateList

      private boolean evaluateList(ScriptMathProcessor mp, int tok, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • addAllLists

      private javajs.util.Lst<SV> addAllLists(javajs.util.Lst<SV> list, javajs.util.Lst<SV> l)
    • evaluateLoad

      private boolean evaluateLoad(ScriptMathProcessor mp, SV[] args, boolean isFile) throws ScriptException
      Throws:
      ScriptException
    • evaluateMath

      private boolean evaluateMath(ScriptMathProcessor mp, SV[] args, int tok)
    • evaluateMeasure

      private boolean evaluateMeasure(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
      Throws:
      ScriptException
    • evaluateModulation

      private boolean evaluateModulation(ScriptMathProcessor mp, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • evaluatePlane

      private boolean evaluatePlane(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
      plane() or intersection()
      Parameters:
      mp -
      args -
      tok -
      Returns:
      true
      Throws:
      ScriptException
    • evaluatePoint

      private boolean evaluatePoint(ScriptMathProcessor mp, SV[] args)
    • evaluatePrompt

      private boolean evaluatePrompt(ScriptMathProcessor mp, SV[] args)
    • evaluateQuaternion

      private boolean evaluateQuaternion(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
      Throws:
      ScriptException
    • evaluateRandom

      private boolean evaluateRandom(ScriptMathProcessor mp, SV[] args)
    • evaluateRowCol

      private boolean evaluateRowCol(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
      Throws:
      ScriptException
    • evaluateIn

      private boolean evaluateIn(ScriptMathProcessor mp, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • evaluateReplace

      private boolean evaluateReplace(ScriptMathProcessor mp, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • evaluateScript

      private boolean evaluateScript(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
      Throws:
      ScriptException
    • evaluateSort

      private boolean evaluateSort(ScriptMathProcessor mp, SV[] args, int tok) throws ScriptException
      sort() or sort(n) or count() or count("xxxx")
      Parameters:
      mp -
      args -
      tok -
      Returns:
      true if no error
      Throws:
      ScriptException
    • evaluateString

      private boolean evaluateString(ScriptMathProcessor mp, int tok, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • evaluateSubstructure

      private boolean evaluateSubstructure(ScriptMathProcessor mp, SV[] args, int tok, boolean isSelector) throws ScriptException
      Throws:
      ScriptException
    • evaluateSymop

      private boolean evaluateSymop(ScriptMathProcessor mp, SV[] args, boolean isProperty) throws ScriptException
      Throws:
      ScriptException
    • evaluateTensor

      private boolean evaluateTensor(ScriptMathProcessor mp, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • evaluateUserFunction

      private boolean evaluateUserFunction(ScriptMathProcessor mp, String name, SV[] args, int tok, boolean isSelector) throws ScriptException
      Throws:
      ScriptException
    • evaluateWithin

      private boolean evaluateWithin(ScriptMathProcessor mp, SV[] args, boolean isAtomProperty) throws ScriptException
      Throws:
      ScriptException
    • evaluateWrite

      private boolean evaluateWrite(ScriptMathProcessor mp, SV[] args) throws ScriptException
      Throws:
      ScriptException
    • getAtomsNearSurface

      private javajs.util.BS getAtomsNearSurface(float distance, String surfaceId)
    • getAtomsNearPts

      private javajs.util.BS getAtomsNearPts(float distance, javajs.util.T3[] points, javajs.util.BS bsInclude)
    • getMinMax

      public Object getMinMax(Object floatOrSVArray, int tok, boolean isSV)
    • getMinMaxPoint

      private Object getMinMaxPoint(Object pointOrSVArray, int tok)
      calculates the statistical value for x, y, and z independently
      Parameters:
      pointOrSVArray -
      tok -
      Returns:
      Point3f or nan
    • getMinMaxQuaternion

      private Object getMinMaxQuaternion(javajs.util.Lst<SV> svData, int tok)
    • getPatternMatcher

      private JmolPatternMatcher getPatternMatcher()
    • opTokenFor

      private T opTokenFor(int tok)
    • setContactBitSets

      public javajs.util.BS setContactBitSets(javajs.util.BS bsA, javajs.util.BS bsB, boolean localOnly, float distance, RadiusData rd, boolean warnMultiModel)