org.ojalgo.machine
Class VirtualMachine

java.lang.Object
  extended by org.ojalgo.machine.BasicMachine
      extended by org.ojalgo.machine.VirtualMachine

public final class VirtualMachine
extends BasicMachine


Field Summary
 String architecture
           
 long cacheL1
          The size of one L1 cache unit in bytes.
 long cacheL2
          The size of one L2 cache unit in bytes.
 long cacheL3
          The size of one L3 cache unit in bytes.
 int cores
          The total number of processor cores.
 int processors
          The number of L3 cache units.
 int units
          The number of L2 cache units.
 
Fields inherited from class org.ojalgo.machine.BasicMachine
memory, threads
 
Method Summary
 void collectGarbage()
           
 IntCount countCores()
           
 IntCount countProcessors()
           
 IntCount countThreads()
           
 IntCount countUnits()
           
 boolean equals(Object obj)
           
static String getArchitecture()
           
 int getAvailableDim1D(long elementSize)
           
 int getAvailableDim2D(long elementSize)
           
 long getAvailableMemory()
           
 int getCacheL1Dim1D(long elementSize)
           
 int getCacheL1Dim2D(long elementSize)
           
 int getCacheL2Dim1D(long elementSize)
          The dimension (length) of an array that will fit in an L2 cache unit given the input element size.
 int getCacheL2Dim2D(long elementSize)
          The dimension (row and/or col count) of a (2 dimensional) array that will fit in an L2 cache unit given the input element size.
 int getCacheL3Dim1D(long elementSize)
           
 int getCacheL3Dim2D(long elementSize)
           
static long getMemory()
           
 int getMemoryDim1D(long elementSize)
           
 int getMemoryDim2D(long elementSize)
           
static int getThreads()
           
 int hashCode()
           
 boolean isMultiCore()
           
 boolean isMultiProcessor()
           
 boolean isMultiThread()
           
 boolean isMultiUnit()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

cacheL1

public final long cacheL1
The size of one L1 cache unit in bytes. Defined to be the memory of the last BasicMachine specified.


cacheL2

public final long cacheL2
The size of one L2 cache unit in bytes. Defined to be the memory of the second last BasicMachine specified.


cacheL3

public final long cacheL3
The size of one L3 cache unit in bytes. Defined to be the memory of the second BasicMachine specified.


architecture

public final String architecture

cores

public final int cores
The total number of processor cores.


processors

public final int processors
The number of L3 cache units. (It is assumed there is 1 L3 cache unit per processor.) If no L3 cache is specified then this will be equal to units.


units

public final int units
The number of L2 cache units. If no L2 cache is specified then this will be equal to 1.

Method Detail

getArchitecture

public static String getArchitecture()

getMemory

public static long getMemory()

getThreads

public static int getThreads()

collectGarbage

public void collectGarbage()

equals

public boolean equals(Object obj)

getAvailableDim1D

public int getAvailableDim1D(long elementSize)

getAvailableDim2D

public int getAvailableDim2D(long elementSize)

getAvailableMemory

public long getAvailableMemory()

hashCode

public int hashCode()

toString

public String toString()
Overrides:
toString in class BasicMachine

countCores

public IntCount countCores()

countProcessors

public IntCount countProcessors()

countThreads

public IntCount countThreads()

countUnits

public IntCount countUnits()

getCacheL1Dim1D

public int getCacheL1Dim1D(long elementSize)

getCacheL1Dim2D

public int getCacheL1Dim2D(long elementSize)

getCacheL2Dim1D

public int getCacheL2Dim1D(long elementSize)
The dimension (length) of an array that will fit in an L2 cache unit given the input element size.


getCacheL2Dim2D

public int getCacheL2Dim2D(long elementSize)
The dimension (row and/or col count) of a (2 dimensional) array that will fit in an L2 cache unit given the input element size.


getCacheL3Dim1D

public int getCacheL3Dim1D(long elementSize)

getCacheL3Dim2D

public int getCacheL3Dim2D(long elementSize)

getMemoryDim1D

public int getMemoryDim1D(long elementSize)

getMemoryDim2D

public int getMemoryDim2D(long elementSize)

isMultiCore

public boolean isMultiCore()

isMultiProcessor

public boolean isMultiProcessor()

isMultiThread

public boolean isMultiThread()

isMultiUnit

public boolean isMultiUnit()