DotMP
Public Member Functions | Static Public Member Functions | Properties | List of all members
DotMP.SharedEnumerable< T, U > Class Template Reference

A specialization of Shared for items that can be indexed with square brackets. The DotMP-parallelized Conjugate Gradient example shows this off fairly well inside of the SpMV function. More...

Inheritance diagram for DotMP.SharedEnumerable< T, U >:
Inheritance graph
[legend]
Collaboration diagram for DotMP.SharedEnumerable< T, U >:
Collaboration graph
[legend]

Public Member Functions

 SharedEnumerable (string name, U value)
 Constructs a new shared variable with the given name and value. More...
 
new void Dispose ()
 Clears the shared variable from memory. Must be called from all threads in the parallel region. Acts as a barrier. More...
 
new U Get ()
 Gets the value of the shared variable as an IList<T>. More...
 
- Public Member Functions inherited from DotMP.Shared< U >
 Shared (string name, T value)
 Creates a new shared variable with the given name and value. Must be called from all threads in the parallel region. Acts as a barrier. More...
 
void Dispose ()
 Clears the shared variable from memory. Must be called from all threads in the parallel region. Acts as a barrier. More...
 
virtual void Dispose (bool disposing)
 Clears the shared variable from memory. Virtual implementation for IDisposable interface. More...
 
void Set (T value)
 Sets the value of the shared variable. Is not thread-safe, so user must ensure thread safety. More...
 
Get ()
 Gets the value of the shared variable. More...
 

Static Public Member Functions

static implicit operator U (SharedEnumerable< T, U > shared)
 Allows for implicit conversion to an array. More...
 
static SharedEnumerable< T, T[]> Create< T > (string name, T[] value)
 Factory method for creating shared arrays. More...
 
static SharedEnumerable< T, List< T > > Create< T > (string name, List< T > value)
 Factory method for creating shared Lists. More...
 
- Static Public Member Functions inherited from DotMP.Shared< U >
static implicit operator T (Shared< T > shared)
 Gets the value of the shared variable. More...
 
static Shared< T > Create< T > (string name, T value)
 Factory method for creating shared variables. More...
 

Properties

this[int index] [get, set]
 Allows for indexing into the shared variable with square brackets. More...
 
- Properties inherited from DotMP.Shared< U >
bool Disposed [get, private set]
 Whether or not the shared variable has been disposed. More...
 

Additional Inherited Members

- Static Protected Attributes inherited from DotMP.Shared< U >
static Dictionary< string, dynamic > shared
 The shared variables. More...
 

Detailed Description

A specialization of Shared for items that can be indexed with square brackets. The DotMP-parallelized Conjugate Gradient example shows this off fairly well inside of the SpMV function.

The factory class for SharedEnumerable<T, U>

Template Parameters
TThe type that the IList is containing.
UThe full IList type.
Type Constraints
U :IList<T> 

Constructor & Destructor Documentation

◆ SharedEnumerable()

DotMP.SharedEnumerable< T, U >.SharedEnumerable ( string  name,
value 
)
inline

Constructs a new shared variable with the given name and value.

Parameters
nameThe name of the shared variable.
valueThe value of the shared variable.

Member Function Documentation

◆ Create< T >() [1/2]

static SharedEnumerable<T, List<T> > DotMP.SharedEnumerable< T, U >.Create< T > ( string  name,
List< T >  value 
)
inlinestatic

Factory method for creating shared Lists.

Template Parameters
TThe type the array contains.
Parameters
nameThe name of the shared enumerable.
valueInitial starting value of the shared enumerable.
Returns
A SharedEnumerable object.

◆ Create< T >() [2/2]

static SharedEnumerable<T, T[]> DotMP.SharedEnumerable< T, U >.Create< T > ( string  name,
T[]  value 
)
inlinestatic

Factory method for creating shared arrays.

Template Parameters
TThe type the array contains.
Parameters
nameThe name of the shared enumerable.
valueInitial starting value of the shared enumerable.
Returns
A SharedEnumerable object.

◆ Dispose()

new void DotMP.SharedEnumerable< T, U >.Dispose ( )
inline

Clears the shared variable from memory. Must be called from all threads in the parallel region. Acts as a barrier.

◆ Get()

new U DotMP.SharedEnumerable< T, U >.Get ( )
inline

Gets the value of the shared variable as an IList<T>.

Returns
The value of the shared variable as an IList<T>.

◆ operator U()

static implicit DotMP.SharedEnumerable< T, U >.operator U ( SharedEnumerable< T, U >  shared)
inlinestatic

Allows for implicit conversion to an array.

Parameters
sharedA SharedEnumerable object.

Property Documentation

◆ this[int index]

T DotMP.SharedEnumerable< T, U >.this[int index]
getset

Allows for indexing into the shared variable with square brackets.

Parameters
indexThe index to fetch.
Returns
The value at that index.

The documentation for this class was generated from the following file: