PULSAR  2.0.0
Parallel Ultra-Light Systolic Array Runtime
 All Data Structures Files Functions Typedefs Enumerations Macros Groups
prt_tuple.c File Reference

PRT tuple. More...

#include "prt_tuple.h"

Go to the source code of this file.

Functions

int * prt_tuple_new (int len,...)
 Creates a new tuple. Allocates memory for the tuple plus the termination symbol (INT_MAX). Fills out the tuple with the integers on the list. There is also a set of macros, prt_tuple_new1/2/3/4/5/6, where the length of the tuple is indicated by the number in the name. Because this is such a tiny function, and is mostly intended to be accessed through macros, skipping error checks for input parameters. More...
 
int prt_tuple_len (int *tuple)
 Returns the length of a tuple. More...
 
int * prt_tuple_cat (int *first_tuple,...)
 Concatenates a list of tuples. Concatenates a variable-length, NULL-terminated, list of tuples. More...
 
void prt_tuple_delete (int *tuple)
 Destroys a tuple. More...
 
int * prt_tuple_copy (int *in_tuple)
 Copies a tuple. More...
 
int prt_tuple_compare (void *tuple_a, void *tuple_b)
 Compares two tuples. More...
 
int prt_tuple_equal (void *tuple_a, void *tuple_b)
 Checks if two tuples are identical. Check if tuples are identical in length and content. More...
 
void prt_tuple_print (int *tuple)
 Prints a tuple. More...
 
unsigned int prt_tuple_hash (void *tuple)
 Hashes a tuple. This function is required by the VSA's tuples hash table. It computes the lenght in characters and calls a string hashing function. More...
 

Detailed Description

PRT tuple.

Author
Jakub Kurzak

PULSAR Runtime http://icl.utk.edu/pulsar/ Copyright (C) 2012-2015 University of Tennessee.

Definition in file prt_tuple.c.

Function Documentation

int* prt_tuple_cat ( int *  first_tuple,
  ... 
)

Concatenates a list of tuples. Concatenates a variable-length, NULL-terminated, list of tuples.

Parameters
first_tuple– The first tuple in the sequence.
...– A list of more tuples.
Returns
The aggregate tuple.

Definition at line 70 of file prt_tuple.c.

int prt_tuple_compare ( void *  tuple_a,
void *  tuple_b 
)

Compares two tuples.

Parameters
tuple_a– The first tuple.
tuple_b– The second tuple.
Return values
-1if tuple_a is less than tuple_b.
0if tuple_a is equal to tuple_b.
1if tuple_a is greater than tuple_b.

Definition at line 141 of file prt_tuple.c.

int* prt_tuple_copy ( int *  in_tuple)

Copies a tuple.

Parameters
in_tuple– The tuple to copy.
Returns
A new copy of the tuple.

Definition at line 115 of file prt_tuple.c.

void prt_tuple_delete ( int *  tuple)

Destroys a tuple.

Parameters
tuple– The tuple to destroy.

Definition at line 101 of file prt_tuple.c.

int prt_tuple_equal ( void *  tuple_a,
void *  tuple_b 
)

Checks if two tuples are identical. Check if tuples are identical in length and content.

Parameters
tuple_a– The first tuple.
tuple_b– The second tuple.
Return values
0if tuples are different.
1if tuples are identical.

Definition at line 167 of file prt_tuple.c.

unsigned int prt_tuple_hash ( void *  tuple)

Hashes a tuple. This function is required by the VSA's tuples hash table. It computes the lenght in characters and calls a string hashing function.

Parameters
tuple– The tuple to hash.
Returns
hash

Definition at line 194 of file prt_tuple.c.

int prt_tuple_len ( int *  tuple)

Returns the length of a tuple.

Parameters
tuple– The tuple to return the length of.
Returns
The length of the tuple without the terminating symbol.

Definition at line 53 of file prt_tuple.c.

void prt_tuple_print ( int *  tuple)

Prints a tuple.

Parameters
tuple– The tuple to print.

Definition at line 178 of file prt_tuple.c.