PrePAN

Sign in to PrePAN

Types::PDL PDL types using Type::Tiny

Good

Synopsis

use Types::PDL -types;
use Type::Params qw[ validate ];
use PDL;

validate( [ pdl ], Piddle );

Description

DESCRIPTION

This module provides Type::Tiny compatible types for PDL.

Types

Piddle

Allows an object blessed into the class PDL, e.g.

validate( [pdl], Piddle );

Piddle accepts the following parameters ("Parameters"):

empty
ndims
ndims_min
ndims_max

Parameters

Some types take optional parameters which add additional constraints on the object. For example, to indicate that only empty piddles are accepted:

validate( [pdl], Piddle[ empty => 1 ] );

The available parameters are:

  • empty

    This accepts a boolean value; if true the piddle must be empty (i.e. the isempty method returns true), if false, it must not be empty.

  • null

    This accepts a boolean value; if true the piddle must be a null piddle, if false, it must not be null.

  • ndims

    This specifies a fixed number of dimensions which the piddle must have. Don't mix use this with ndims_min or ndims_max.

  • ndims_min

    The minimum number of dimensions the piddle may have. Don't specify this with ndims.

  • ndims_max

    The maximum number of dimensions the piddle may have. Don't specify this with ndims.

Comments

Please sign up to post a review.