Exemple #1
0
def get_multi_index(pc_model,ndim):
    """
    Function that returns a 2D array of the PC multiindex.
    Input:
       pc_model, ndim.
    Output:
       2D array of the PC multiindex
    """
    # Get number of PC terms
    totpc = pc_model.GetNumberPCTerms()
    # Create  2D int UQTk array with width of ndim and height of totpc
    mi_uqtk = uqtkarray.intArray2D(totpc,ndim)
    # Populate UQTk array with PC multiindex
    pc_model.GetMultiIndex(mi_uqtk)
    # Convert UQTk array to numpy array
    mi = np.zeros((totpc,ndim))
    mi_uqtk.getnpdblArray(mi)
    return mi
Exemple #2
0
def mkSzInt2D(dim1, dim2):
    return uqtkarray.intArray2D(dim1, dim2)
Exemple #3
0
def mkBlnkInt2D():
    return uqtkarray.intArray2D()
Exemple #4
0
def mkSetInt2D(v_np):
    v_uqtk = uqtkarray.intArray2D(v_np.shape[0], v_np.shape[1])
    v_uqtk.setnpdblArray(v_np)
    return v_uqtk