/* Converts an orientation matrix made up of 0,+1,and -1 to a scalar representation.  */
unsigned short inv_orientation_matrix_to_scalar(const signed char *mtx)
/* Converts an orientation matrix made up of 0,+1,and -1 to a scalar representation.  */
unsigned short inv_orientation_matrix_to_scalar(const signed char *mtx)
{
    unsigned short scalar;
    scalar = inv_row_2_scale(mtx);
    scalar |= inv_row_2_scale(mtx + 3) << 3;
    scalar |= inv_row_2_scale(mtx + 6) << 6;
    return scalar;
}