./PaxHeaders/communications-1.2.7 0000644 0000000 0000000 00000000132 14746720432 013720 x ustar 00 30 mtime=1738252570.128527875
30 atime=1738252593.659705065
30 ctime=1738252593.659705065
communications-1.2.7/ 0000755 0001750 0001750 00000000000 14746720432 012764 5 ustar 00nir nir communications-1.2.7/PaxHeaders/src 0000644 0000000 0000000 00000000132 14746720461 014354 x ustar 00 30 mtime=1738252593.658705057
30 atime=1738252593.659705065
30 ctime=1738252593.659705065
communications-1.2.7/src/ 0000755 0001750 0001750 00000000000 14746720461 013555 5 ustar 00nir nir communications-1.2.7/src/PaxHeaders/ov-galois.cc 0000644 0000000 0000000 00000000074 14746720302 016637 x ustar 00 30 atime=1738252570.195528379
30 ctime=1738252593.659705065
communications-1.2.7/src/ov-galois.cc 0000644 0001750 0001750 00000045472 14746720302 015772 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
#include
#include
#include
#ifdef HAVE_OCTAVE_GRIPES_H
#include
#endif
#ifdef HAVE_OCTAVE_ERRWARN_H
#include
#endif
#include
#include
#ifdef HAVE_OCTAVE_OVL_H
#include
#elif HAVE_OCTAVE_OCT_OBJ_H
#include
#endif
#include
#include
#if defined(HAVE_OCTAVE_LS_OCT_TEXT_H)
# include
#else
# include
#endif
#include "galois.h"
#include "ov-galois.h"
#if defined (HAVE_HDF5)
# if defined (HAVE_HDF5_H)
# include
# endif
# if defined (HAVE_OCTAVE_OCT_HDF5_TYPES_H)
# include "oct-hdf5-types.h"
# endif
# if defined (OCTAVE_ENABLE_64)
# define H5T_NATIVE_IDX H5T_NATIVE_INT64
# else
# define H5T_NATIVE_IDX H5T_NATIVE_INT
# endif
#endif
#if ! defined (X_CAST)
# define X_CAST(T, E) (T) (E)
#endif
#if defined (DEFINE_OCTAVE_ALLOCATOR)
DEFINE_OCTAVE_ALLOCATOR (octave_galois);
#endif
DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (octave_galois, "galois", "galois");
octave_value
octave_galois::resize (const dim_vector& dv, bool) const
{
if (dv.length () > 2)
{
error ("Can not resize galois structure to NDArray");
return octave_value ();
}
galois retval (gval);
retval.resize (dv);
return new octave_galois (retval);
}
octave_value_list
octave_galois::dotref (const octave_value_list& idx)
{
octave_value_list retval;
assert (idx.length () == 1);
std::string nm = idx(0).string_value ();
if (nm == __GALOIS_PRIMPOLY_STR)
retval(0) = octave_value ((double)gval.primpoly ());
else if (nm == __GALOIS_ORDER_STR)
retval(0) = octave_value ((double)gval.m ());
else if (nm == __GALOIS_DATA_STR)
{
int r = gval.rows ();
int c = gval.columns ();
Matrix data (r, c);
for (int i = 0; i < r; i++)
for (int j = 0; j < c; j++)
data(i, j) = (double)gval(i, j);
retval(0) = octave_value (data);
}
#ifdef GALOIS_DISP_PRIVATES
else if (nm == __GALOIS_LENGTH_STR)
retval(0) = octave_value ((double)gval.n ());
else if (nm == __GALOIS_ALPHA_TO_STR)
{
int n = gval.n ();
Matrix data (n+1, 1);
for (int i = 0; i < n+1; i++)
data(i, 0) = (double)gval.alpha_to (i);
retval(0) = octave_value (data);
}
else if (nm == __GALOIS_INDEX_OF_STR)
{
int n = gval.n ();
Matrix data (n+1, 1);
for (int i = 0; i < n+1; i++)
data(i, 0) = (double)gval.index_of (i);
retval(0) = octave_value (data);
}
#endif
else
error ("galois structure has no member `%s'", nm.c_str ());
return retval;
}
octave_value
octave_galois::do_index_op (const octave_value_list& idx,
bool resize_ok)
{
octave_value retval;
int len = idx.length ();
switch (len)
{
case 2:
{
idx_vector i = idx (0).index_vector ();
idx_vector j = idx (1).index_vector ();
retval = new octave_galois (gval.index (i, j, resize_ok));
}
break;
case 1:
{
idx_vector i = idx (0).index_vector ();
retval = new octave_galois (gval.index (i, resize_ok));
}
break;
default:
{
std::string n = type_name ();
error ("invalid number of indices (%d) for %s value",
len, n.c_str ());
}
break;
}
return retval;
}
octave_value
octave_galois::subsref (const std::string &type,
const std::list& idx)
{
octave_value retval;
int skip = 1;
switch (type[0])
{
case '(':
retval = do_index_op (idx.front (), true);
break;
case '.':
{
octave_value_list t = dotref (idx.front ());
retval = (t.length () == 1) ? t(0) : octave_value (t);
}
break;
case '{':
error ("%s cannot be indexed with %c", type_name ().c_str (), type[0]);
break;
default:
panic_impossible ();
}
retval = retval.next_subsref (type, idx, skip);
return retval;
}
bool
octave_galois::is_true (void) const
{
bool retval = false;
if (rows () > 0 && columns () > 0)
{
boolMatrix m = (gval.all () . all ());
retval = (m.rows () == 1 && m.columns () == 1 && m(0, 0));
}
return retval;
}
bool
octave_galois::print_as_scalar (void) const
{
int nr = rows ();
int nc = columns ();
return ((nr == 1 && nc == 1) || (nr == 0 || nc == 0));
}
void
#if defined (HAVE_OCTAVE_BASE_VALUE_PRINT_CONST)
octave_galois::print (std::ostream& os, bool) const
#else
octave_galois::print (std::ostream& os, bool)
#endif
{
print_raw (os);
}
void
octave_galois::print_raw (std::ostream& os, bool) const
{
bool first = true;
int m = gval.m ();
int primpoly = gval.primpoly ();
Matrix data (gval.rows (), gval.cols ());
indent (os);
if (m == 1)
os << "GF(2) array.";
else
{
os << "GF(2^" << m << ") array. Primitive Polynomial = ";
for (int i = m; i >= 0; i--)
{
if (primpoly & (1< 0)
{
if (first)
{
first = false;
os << "D";
}
else
os << "+D";
if (i != 1)
os << "^" << i;
}
else
{
if (first)
{
first = false;
os << "1";
}
else
os << "+1";
}
}
}
os << " (decimal " << primpoly << ")";
}
newline (os);
newline (os);
indent (os);
os << "Array elements = ";
newline (os);
newline (os);
for (int i = 0; i < gval.rows (); i++)
for (int j = 0; j < gval.columns (); j++)
data(i, j) = (double)gval(i, j);
octave_print_internal (os, data, false, current_print_indent_level ());
newline (os);
}
bool
octave_galois::print_name_tag (std::ostream& os, const std::string& name) const
{
bool retval = false;
indent (os);
// Vstruct_levels_to_print was made static in Octave 3.4, which means
// the name_tag might be printed on a seperate line when it shouldn't be.
#if 0
if (Vstruct_levels_to_print < 0)
#else
if (false)
#endif
os << name << " = ";
else
{
os << name << " =";
newline (os);
retval = true;
}
return retval;
}
void
octave_galois::print_info (std::ostream& os, const std::string& prefix) const
{
gval.print_info (os, prefix);
}
double
octave_galois::double_value (bool) const
{
double retval = octave_NaN;
if (rows () > 0 && columns () > 0)
{
OCTAVE__WARN_INVALID_CONVERSION ("Octave:array-as-scalar",
"real matrix", "real scalar");
retval = (double) gval (0, 0);
}
else
OCTAVE__ERR_INVALID_CONVERSION ("galois", "real scalar");
return retval;
}
Complex
octave_galois::complex_value (bool) const
{
double tmp = octave_NaN;
Complex retval (tmp, tmp);
if (rows () > 0 && columns () > 0)
{
OCTAVE__WARN_INVALID_CONVERSION ("Octave:array-as-scalar",
"real matrix", "real scalar");
retval = (double) gval (0, 0);
}
else
OCTAVE__ERR_INVALID_CONVERSION ("galois", "complex scalar");
return retval;
}
Matrix
octave_galois::matrix_value (bool) const
{
Matrix retval;
retval.resize (rows (), columns ());
for (int i = 0; i < rows (); i++)
for (int j = 0; j < columns (); j++)
retval(i, j) = gval(i, j);
return retval;
}
NDArray
octave_galois::array_value (bool) const
{
int nr = rows ();
int nc = columns ();
dim_vector dv (nr, nc);
NDArray retval (dv);
for (int i = 0; i < nr; i++)
for (int j = 0; j < nc; j++)
retval(i + j*nr) = gval(i, j);
return retval;
}
void
octave_galois::assign (const octave_value_list& idx,
const galois& rhs)
{
int len = idx.length ();
if (gval.have_field () && rhs.have_field ())
{
if ((gval.m () != rhs.m ()) || (gval.primpoly () != rhs.primpoly ()))
{
(*current_liboctave_error_handler) ("can not assign data between two different Galois Fields");
return;
}
}
switch (len)
{
case 2:
{
idx_vector i = idx (0).index_vector ();
idx_vector j = idx (1).index_vector ();
gval.assign (i, j, rhs);
}
break;
case 1:
{
idx_vector i = idx (0).index_vector ();
gval.assign (i, rhs);
}
break;
default:
error ("invalid number of indices (%d) for galois assignment",
len);
break;
}
}
bool
octave_galois::save_ascii (std::ostream& os)
{
dim_vector d = dims ();
Matrix tmp = matrix_value ();
// Note use N-D way of writing matrix for eventual conversion
// of octave_galois to handle N-D arrays
os << "# m: " << m () << "\n";
os << "# prim: " << primpoly () << "\n";
os << "# ndims: " << d.length () << "\n";
for (int i = 0; i < d.length (); i++)
os << " " << d (i);
os << "\n" << tmp;
return true;
}
bool
octave_galois::load_ascii (std::istream& is)
{
int mord, prim, mdims;
bool success = true;
if (extract_keyword (is, "m", mord) && extract_keyword (is, "prim", prim) &&
extract_keyword (is, "ndims", mdims))
{
dim_vector dv;
dv.resize (mdims);
for (int i = 0; i < mdims; i++)
is >> dv(i);
if (dv.length () != 2)
{
error ("load: N-D galois matrix not supported");
success = false;
}
else
{
Matrix tmp (dv(0), dv(1));
is >> tmp;
if (!is)
{
error ("load: failed to load matrix constant");
success = false;
}
gval = galois (tmp, mord, prim);
}
}
else
{
error ("load: failed to extract galois field order, primitive and/or imension");
success = false;
}
return success;;
}
bool
octave_galois::save_binary (std::ostream& os, bool& save_as_floats)
{
char tmp = m ();
os.write (X_CAST (char *, &tmp), 1);
int32_t itmp = primpoly ();
os.write (X_CAST (char *, &itmp), 4);
dim_vector d = dims ();
// Don't handle N-D arrays yet
if (d.length () != 2)
return false;
// Use negative value for ndims to be consistent with other formats
itmp = - d.length ();
os.write (X_CAST (char *, &itmp), 4);
for (int i = 0; i < d.length (); i++)
{
itmp = d(i);
os.write (X_CAST (char *, &itmp), 4);
}
Matrix m = matrix_value ();
save_type st;
if (tmp < 8)
st = LS_U_CHAR;
else if (tmp < 16)
st = LS_U_SHORT;
else
st = LS_U_INT;
const double *mtmp = m.data ();
write_doubles (os, mtmp, st, d.numel ());
return true;
}
bool
octave_galois::load_binary (std::istream& is, bool swap,
OCTAVE_MACH_INFO_FLOAT_FORMAT fmt)
{
char mord;
int32_t prim, mdims;
if (! is.read (X_CAST (char *, &mord), 1))
return false;
if (! is.read (X_CAST (char *, &prim), 4))
return false;
if (swap)
swap_bytes <4> (X_CAST (char *, &prim));
if (! is.read (X_CAST (char *, &mdims), 4))
return false;
if (swap)
swap_bytes <4> (X_CAST (char *, &mdims));
// Don't treat N-D arrays yet
if (mdims == -2)
{
mdims = - mdims;
int32_t di;
dim_vector dv;
dv.resize (mdims);
for (int i = 0; i < mdims; i++)
{
if (! is.read (X_CAST (char *, &di), 4))
return false;
if (swap)
swap_bytes <4> (X_CAST (char *, &di));
dv(i) = di;
}
char tmp;
if (! is.read (X_CAST (char *, &tmp), 1))
return false;
Matrix m (dv(0), dv(1));
double *re = m.fortran_vec ();
read_doubles (is, re, X_CAST (save_type, tmp), dv.numel (), swap, fmt);
if (! is)
return false;
gval = galois (m, mord, prim);
}
return true;
}
bool
octave_galois::save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats)
{
bool retval = true;
#if defined (HAVE_HDF5)
Matrix mval = matrix_value ();
hid_t group_hid = -1;
#if HAVE_HDF5_18
group_hid = H5Gcreate (loc_id, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
#else
group_hid = H5Gcreate (loc_id, name, 0);
#endif
if (group_hid < 0 ) return false;
dim_vector d = dims ();
OCTAVE_LOCAL_BUFFER (hsize_t, hdims, d.length () > 2 ? d.length () : 3);
hid_t space_hid = -1, data_hid = -1;
char tmp;
int32_t itmp;
space_hid = H5Screate_simple (0, hdims, (hsize_t*) 0);
if (space_hid < 0)
{
H5Gclose (group_hid);
return false;
}
#if HAVE_HDF5_18
data_hid = H5Dcreate (group_hid, "m", H5T_NATIVE_UCHAR, space_hid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
#else
data_hid = H5Dcreate (group_hid, "m", H5T_NATIVE_UCHAR, space_hid,
H5P_DEFAULT);
#endif
if (data_hid < 0)
{
H5Sclose (space_hid);
H5Gclose (group_hid);
return false;
}
tmp = m ();
retval = H5Dwrite (data_hid, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT,
(void*) &tmp) >= 0;
H5Dclose (data_hid);
if (!retval)
{
H5Sclose (space_hid);
H5Gclose (group_hid);
return false;
}
#if HAVE_HDF5_18
data_hid = H5Dcreate (group_hid, "prim", H5T_NATIVE_UINT, space_hid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
#else
data_hid = H5Dcreate (group_hid, "prim", H5T_NATIVE_UINT, space_hid,
H5P_DEFAULT);
#endif
if (data_hid < 0)
{
H5Sclose (space_hid);
H5Gclose (group_hid);
return false;
}
itmp = primpoly ();
retval = H5Dwrite (data_hid, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
(void*) &itmp) >= 0;
H5Dclose (data_hid);
if (!retval)
{
H5Sclose (space_hid);
H5Gclose (group_hid);
return false;
}
H5Sclose (space_hid);
// Octave uses column-major, while HDF5 uses row-major ordering
for (int i = 0, j = d.length () - 1; i < d.length (); i++, j--)
hdims[i] = d (j);
space_hid = H5Screate_simple (d.length (), hdims, (hsize_t*) 0);
if (space_hid < 0) return false;
double *mtmp = mval.fortran_vec ();
OCTAVE_LOCAL_BUFFER (uint32_t, vtmp, d.numel ());
hid_t save_type_hid = H5T_NATIVE_UINT;
if (tmp <= 8)
{
save_type_hid = H5T_NATIVE_UCHAR;
char *wtmp = (char *)vtmp;
for (int i = 0; i < d.numel (); i++)
wtmp[i] = (char) mtmp[i];
}
else if (tmp <= 16)
{
save_type_hid = H5T_NATIVE_USHORT;
uint16_t *wtmp = (uint16_t *)vtmp;
for (int i = 0; i < d.numel (); i++)
wtmp[i] = (uint16_t) mtmp[i];
}
else
{
for (int i = 0; i < d.numel (); i++)
vtmp[i] = (uint32_t) mtmp[i];
}
#if HAVE_HDF5_18
data_hid = H5Dcreate (group_hid, "val", save_type_hid, space_hid,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
#else
data_hid = H5Dcreate (group_hid, "val", save_type_hid, space_hid,
H5P_DEFAULT);
#endif
if (data_hid < 0)
{
H5Sclose (space_hid);
H5Gclose (group_hid);
return false;
}
retval = H5Dwrite (data_hid, save_type_hid, H5S_ALL, H5S_ALL,
H5P_DEFAULT, (void*) vtmp) >= 0;
H5Dclose (data_hid);
H5Sclose (space_hid);
H5Gclose (group_hid);
#elif defined (HAVE_OCTAVE_BASE_VALUE_GRIPE_LOAD_SAVE)
gripe_save ("hdf5");
#else
warning ("galois: saving hdf5 files not available");
#endif
return retval;
}
bool
octave_galois::load_hdf5 (octave_hdf5_id loc_id, const char *name)
{
bool retval = false;
#if defined (HAVE_HDF5)
char mord;
unsigned int prim;
hid_t group_hid, data_hid, space_id;
hsize_t rank;
#if HAVE_HDF5_18
group_hid = H5Gopen (loc_id, name, H5P_DEFAULT);
#else
group_hid = H5Gopen (loc_id, name);
#endif
if (group_hid < 0 ) return false;
#if HAVE_HDF5_18
data_hid = H5Dopen (group_hid, "m", H5P_DEFAULT);
#else
data_hid = H5Dopen (group_hid, "m");
#endif
space_id = H5Dget_space (data_hid);
rank = H5Sget_simple_extent_ndims (space_id);
if (rank != 0)
{
H5Dclose (data_hid);
H5Gclose (group_hid);
return false;
}
if (H5Dread (data_hid, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL,
H5P_DEFAULT, (void *) &mord) < 0)
{
H5Dclose (data_hid);
H5Gclose (group_hid);
return false;
}
H5Dclose (data_hid);
#if HAVE_HDF5_18
data_hid = H5Dopen (group_hid, "prim", H5P_DEFAULT);
#else
data_hid = H5Dopen (group_hid, "prim");
#endif
space_id = H5Dget_space (data_hid);
rank = H5Sget_simple_extent_ndims (space_id);
if (rank != 0)
{
H5Dclose (data_hid);
H5Gclose (group_hid);
return false;
}
if (H5Dread (data_hid, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, (void *) &prim) < 0)
{
H5Dclose (data_hid);
H5Gclose (group_hid);
return false;
}
H5Dclose (data_hid);
#if HAVE_HDF5_18
data_hid = H5Dopen (group_hid, "val", H5P_DEFAULT);
#else
data_hid = H5Dopen (group_hid, "val");
#endif
space_id = H5Dget_space (data_hid);
rank = H5Sget_simple_extent_ndims (space_id);
// Only handle matrices for now
if (rank != 2)
{
H5Sclose (space_id);
H5Dclose (data_hid);
H5Gclose (group_hid);
return false;
}
OCTAVE_LOCAL_BUFFER (hsize_t, hdims, rank);
OCTAVE_LOCAL_BUFFER (hsize_t, maxdims, rank);
H5Sget_simple_extent_dims (space_id, hdims, maxdims);
MArray m (dim_vector (hdims[1], hdims[0]));
int *re = m.fortran_vec ();
if (H5Dread (data_hid, H5T_NATIVE_UINT, H5S_ALL, H5S_ALL,
H5P_DEFAULT, (void *) re) >= 0)
{
retval = true;
gval = galois (m, mord, prim);
}
H5Sclose (space_id);
H5Dclose (data_hid);
#elif defined (HAVE_OCTAVE_BASE_VALUE_GRIPE_LOAD_SAVE)
gripe_load ("hdf5");
#else
warning ("galois: loading hdf5 files not available");
#endif
return retval;
}
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/ov-galois.h 0000644 0000000 0000000 00000000062 14746720302 016476 x ustar 00 20 atime=1738252482
30 ctime=1738252593.659705065
communications-1.2.7/src/ov-galois.h 0000644 0001750 0001750 00000012157 14746720302 015626 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#if !defined (octave_galois_h)
#define octave_galois_h 1
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
#include
#include "galois.h"
// The keys of the values in the octave map
#define __GALOIS_PRIMPOLY_STR "prim_poly"
#define __GALOIS_ORDER_STR "m"
#define __GALOIS_DATA_STR "x"
#ifdef GALOIS_DISP_PRIVATES
#define __GALOIS_LENGTH_STR "n"
#define __GALOIS_ALPHA_TO_STR "alpha_to"
#define __GALOIS_INDEX_OF_STR "index_of"
#endif
#if !defined (HAVE_OCTAVE_HDF5_ID_TYPE)
#if defined (HAVE_HDF5)
typedef hid_t octave_hdf5_id;
#else
typedef int octave_hdf5_id;
#endif
#endif
#if ! defined (OV_REP_TYPE)
# define OV_REP_TYPE octave_base_value
#endif
//class octave_value_list;
//class tree_walker;
// Data structures.
class
octave_galois : public octave_base_value
{
public:
octave_galois (const Matrix& data = Matrix (0, 0), const int _m = 1,
const int _primpoly = 0)
{ gval = galois (data, _m, _primpoly); }
octave_galois (const galois& gm)
: octave_base_value (), gval (gm) { }
octave_galois (const octave_galois& s)
: octave_base_value (), gval (s.gval) { }
~octave_galois (void) { };
OV_REP_TYPE *clone (void) const { return new octave_galois (*this); }
OV_REP_TYPE *empty_clone (void) const { return new octave_galois (); }
octave_value subsref (const std::string &type,
const std::list& idx);
octave_value_list subsref (const std::string& type,
const std::list& idx, int)
{ return subsref (type, idx); }
octave_value do_index_op (const octave_value_list& idx,
bool resize_ok);
octave_value do_index_op (const octave_value_list& idx)
{ return do_index_op (idx, 0); }
void assign (const octave_value_list& idx, const galois& rhs);
dim_vector dims (void) const { return gval.dims (); }
octave_value resize (const dim_vector& dv, bool) const;
size_t byte_size (void) const { return gval.byte_size (); }
octave_value all (int dim = 0) const { return gval.all (dim); }
octave_value any (int dim = 0) const { return gval.any (dim); }
bool is_matrix_type (void) const { return true; }
bool is_defined (void) const { return true; }
bool OV_ISNUMERIC (void) const { return true; }
bool is_constant (void) const { return true; }
bool is_true (void) const;
bool is_galois_type (void) const { return true; }
bool print_as_scalar (void) const;
#if defined (HAVE_OCTAVE_BASE_VALUE_PRINT_CONST)
void print (std::ostream& os, bool pr_as_read_syntax = false) const;
#else
void print (std::ostream& os, bool pr_as_read_syntax = false);
#endif
void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const;
bool print_name_tag (std::ostream& os, const std::string& name) const;
void print_info (std::ostream& os, const std::string& prefix) const;
bool is_real_matrix (void) const { return false; }
bool OV_ISREAL (void) const { return false; }
// FIXME
bool valid_as_scalar_index (void) const { return false; }
double double_value (bool = false) const;
double scalar_value (bool frc_str_conv = false) const
{ return double_value (frc_str_conv); }
Matrix matrix_value (bool = false) const;
NDArray array_value (bool = false) const;
Complex complex_value (bool = false) const;
ComplexMatrix complex_matrix_value (bool = false) const
{ return ComplexMatrix ( matrix_value ()); }
galois galois_value (void) const { return gval; }
octave_value_list dotref (const octave_value_list& idx);
int m (void) const { return gval.m (); }
int primpoly (void) const { return gval.primpoly (); }
bool save_ascii (std::ostream& os);
bool load_ascii (std::istream& is);
bool save_binary (std::ostream& os, bool& save_as_floats);
bool load_binary (std::istream& is, bool swap,
OCTAVE_MACH_INFO_FLOAT_FORMAT fmt);
bool save_hdf5 (octave_hdf5_id loc_id, const char *name, bool save_as_floats);
bool load_hdf5 (octave_hdf5_id loc_id, const char *name);
private:
// The array used to managed the Galios Field data
galois gval;
#if defined (DECLARE_OCTAVE_ALLOCATOR)
DECLARE_OCTAVE_ALLOCATOR
#endif
DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA
};
#endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/undef-ah-octave.h 0000644 0000000 0000000 00000000062 14746720302 017544 x ustar 00 20 atime=1738252482
30 ctime=1738252593.659705065
communications-1.2.7/src/undef-ah-octave.h 0000644 0001750 0001750 00000000706 14746720302 016671 0 ustar 00nir nir /* To be included at the top of config.h (by autoheader). Avoid
warnings for redefining AH-generated preprocessor symbols of
Octave. */
#ifdef PACKAGE_BUGREPORT
#undef PACKAGE_BUGREPORT
#endif
#ifdef PACKAGE_NAME
#undef PACKAGE_NAME
#endif
#ifdef PACKAGE_STRING
#undef PACKAGE_STRING
#endif
#ifdef PACKAGE_TARNAME
#undef PACKAGE_TARNAME
#endif
#ifdef PACKAGE_URL
#undef PACKAGE_URL
#endif
#ifdef PACKAGE_VERSION
#undef PACKAGE_VERSION
#endif
communications-1.2.7/src/PaxHeaders/gf.cc 0000644 0000000 0000000 00000000074 14746720302 015333 x ustar 00 30 atime=1738252570.195528379
30 ctime=1738252593.659705065
communications-1.2.7/src/gf.cc 0000644 0001750 0001750 00000242552 14746720302 014464 0 ustar 00nir nir // Copyright (C) 1994-1997 Robert Morelos-Zaragoza
// Copyright (C) 2002 Phil Karn
// Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
/*
Part of the function rsenc and the function decode_rs are from Phil Karn. See
the website http://www.ka9q.net/code/fec for more details.
Parts of the function bchenco and bchdeco are from Robert Morelos-Zaragoza. See
the website http://www.eccpage.com for more details. Permission has been granted
for a GPL release of his code
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
#ifdef HAVE_OCTAVE_INTERPRETER_H
#include
#endif
#include
#ifdef HAVE_OCTAVE_GRIPES_H
#include
#define OCTAVE__ERR_SQUARE_MATRIX_REQUIRED(a) gripe_square_matrix_required(a)
#endif
#ifdef HAVE_OCTAVE_ERRWARN_H
#include
#define OCTAVE__ERR_SQUARE_MATRIX_REQUIRED(a) err_square_matrix_required(a, "")
#endif
#include
#include
#include
#include
#include "galois.h"
#include "ov-galois.h"
static bool galois_type_loaded = false;
// PKG_ADD: autoload ("isgalois", "gf.oct");
// PKG_DEL: autoload ("isgalois", "gf.oct", "remove");
DEFUN_DLD (isgalois, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} isgalois (@var{expr})\n\
Return 1 if the value of the expression @var{expr} is a Galois Field.\n\
@end deftypefn")
{
if (args.length () != 1)
print_usage ();
else if (!galois_type_loaded)
// Can be of Galois type if the type isn't load :-/
return octave_value (0.);
else
return octave_value (args(0).type_id () ==
octave_galois::static_type_id ());
return octave_value ();
}
/*
%% Test input validation
%!error isgalois ()
%!error isgalois (1, 2)
*/
// FIXME:
// I want to replace the "16" below with __OCTAVE_GALOIS_MAX_M_AS_STRING,
// but as I don't run the preprocessor when getting the help from the
// functions, this can't be done at the point. So if more default primitive
// polynomials are added to galoisfield.cc, need to update the "16" here
// as well!!
#ifdef DEFMETHOD_DLD
DEFMETHOD_DLD (gf, interp, args, nargout,
#else
DEFUN_DLD (gf, args, nargout,
#endif
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{y} =} gf (@var{x})\n\
@deftypefnx {Loadable Function} {@var{y} =} gf (@var{x}, @var{m})\n\
@deftypefnx {Loadable Function} {@var{y} =} gf (@var{x}, @var{m}, @var{primpoly})\n\
Creates a Galois field array GF(2^@var{m}) from the matrix @var{x}. The\n\
Galois field has 2^@var{m} elements, where @var{m} must be between 1 and 16.\n\
The elements of @var{x} must be between 0 and 2^@var{m} - 1. If @var{m} is\n\
undefined it defaults to the value 1.\n\
\n\
The primitive polynomial to use in the creation of Galois field can be\n\
specified with the @var{primpoly} variable. If this is undefined a default\n\
primitive polynomial is used. It should be noted that the primitive\n\
polynomial must be of the degree @var{m} and it must be irreducible.\n\
\n\
The output of this function is recognized as a Galois field by Octave and\n\
other matrices will be converted to the same Galois field when used in an\n\
arithmetic operation with a Galois field.\n\
\n\
@seealso{isprimitive, primpoly}\n\
@end deftypefn")
{
Matrix data;
octave_value retval;
int nargin = args.length ();
int m = 1;
int primpoly = 0;
if (nargin < 1 || nargin > 3)
{
print_usage ();
return retval;
}
data = args(0).matrix_value ();
if (nargin > 1)
m = args(1).int_value ();
if (nargin > 2)
primpoly = args(2).int_value ();
if (!galois_type_loaded)
{
octave_galois::register_type ();
#ifndef DEFMETHOD_DLD
install_gm_gm_ops ();
install_m_gm_ops ();
install_gm_m_ops ();
install_s_gm_ops ();
install_gm_s_ops ();
galois_type_loaded = true;
mlock ();
#else
interp.mlock ();
octave::type_info& ti = interp.get_type_info ();
install_gm_gm_ops (ti);
install_m_gm_ops (ti);
install_gm_m_ops (ti);
install_s_gm_ops (ti);
install_gm_s_ops (ti);
galois_type_loaded = true;
#endif
}
retval = new octave_galois (data, m, primpoly);
return retval;
}
/*
%% Test input validation
%!error gf ()
%!error gf (1, 2, 3, 4)
*/
static octave_value
make_gdiag (const octave_value& a, const octave_value& b)
{
octave_value retval;
if ((!galois_type_loaded) || (a.type_id () !=
octave_galois::static_type_id ()))
OCTAVE__ERR_WRONG_TYPE_ARG ("gdiag", a);
else
{
galois m = ((const octave_galois&) a.get_rep ()).galois_value ();
int k = b.nint_value ();
int nr = m.rows ();
int nc = m.columns ();
if (nr == 0 || nc == 0)
retval = new octave_galois (m);
else if (nr == 1 || nc == 1)
{
int roff = 0;
int coff = 0;
if (k > 0)
{
roff = 0;
coff = k;
}
else if (k < 0)
{
k = -k;
roff = k;
coff = 0;
}
if (nr == 1)
{
int n = nc + k;
galois r (n, n, 0, m.m (), m.primpoly ());
for (int i = 0; i < nc; i++)
r (i+roff, i+coff) = m (0, i);
retval = new octave_galois (r);
}
else
{
int n = nr + k;
galois r (n, n, 0, m.m (), m.primpoly ());
for (int i = 0; i < nr; i++)
r (i+roff, i+coff) = m (i, 0);
retval = new octave_galois (r);
}
}
else
{
galois r = m.diag (k);
if (r.numel () > 0)
retval = new octave_galois (r);
}
}
return retval;
}
// PKG_ADD: autoload ("gdiag", "gf.oct");
// PKG_DEL: autoload ("gdiag", "gf.oct", "remove");
DEFUN_DLD (gdiag, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} gdiag (@var{v}, @var{k})\n\
Return a diagonal matrix with Galois vector @var{v} on diagonal @var{k}.\n\
The second argument is optional. If it is positive, the vector is placed on\n\
the @var{k}-th super-diagonal. If it is negative, it is placed on the\n\
@var{-k}-th sub-diagonal. The default value of @var{k} is 0, and the\n\
vector is placed on the main diagonal. For example,\n\
\n\
@example\n\
gdiag (gf ([1, 2, 3], 2), 1)\n\
ans =\n\
GF(2^2) array. Primitive Polynomial = D^2+D+1 (decimal 7)\n\
\n\
Array elements =\n\
\n\
0 1 0 0\n\
0 0 2 0\n\
0 0 0 3\n\
0 0 0 0\n\
\n\
@end example\n\
@seealso{diag}\n\
@end deftypefn")
{
octave_value retval;
int nargin = args.length ();
if (nargin == 1 && args(0).is_defined ())
retval = make_gdiag (args(0), octave_value (0.));
else if (nargin == 2 && args(0).is_defined () && args(1).is_defined ())
retval = make_gdiag (args(0), args(1));
else
print_usage ();
return retval;
}
/*
%% Test input validation
%!error gdiag ()
%!error gdiag (1, 2, 3)
*/
// PKG_ADD: autoload ("greshape", "gf.oct");
// PKG_DEL: autoload ("greshape", "gf.oct", "remove");
DEFUN_DLD (greshape, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} greshape (@var{a}, @var{m}, @var{n})\n\
Return a matrix with @var{m} rows and @var{n} columns whose elements are\n\
taken from the Galois array @var{a}. To decide how to order the elements,\n\
Octave pretends that the elements of a matrix are stored in column-major\n\
order (like Fortran arrays are stored).\n\
\n\
For example,\n\
\n\
@example\n\
greshape (gf ([1, 2, 3, 4], 3), 2, 2)\n\
ans =\n\
GF(2^3) array. Primitive Polynomial = D^3+D+1 (decimal 11)\n\
\n\
Array elements =\n\
\n\
1 3\n\
2 4\n\
\n\
@end example\n\
\n\
The @code{greshape} function is equivalent to\n\
\n\
@example\n\
@group\n\
retval = gf (zeros (m, n), a.m, a.prim_poly);\n\
retval(:) = a;\n\
@end group\n\
@end example\n\
\n\
@noindent\n\
but it is somewhat less cryptic to use @code{reshape} instead of the\n\
colon operator. Note that the total number of elements in the original\n\
matrix must match the total number of elements in the new matrix.\n\
@seealso{reshape, :}\n\
@end deftypefn")
{
octave_value retval;
int nargin = args.length ();
if (nargin != 2 && nargin != 3)
{
print_usage ();
}
else
{
int mr = 0, mc = 0;
if ((!galois_type_loaded) || (args(0).type_id () !=
octave_galois::static_type_id ()))
{
OCTAVE__ERR_WRONG_TYPE_ARG ("greshape", args(0));
return retval;
}
galois a = ((const octave_galois&) args(0).get_rep ()).galois_value ();
if (nargin == 2)
{
RowVector tmp = args(1).row_vector_value ();
mr = (int)tmp(0);
mc = (int)tmp(1);
}
else if (nargin == 3)
{
mr = args(1).nint_value ();
mc = args(2).nint_value ();
}
int nr = a.rows ();
int nc = a.cols ();
if ((nr * nc) != (mr * mc))
error ("greshape: sizes must match");
else
{
RowVector tmp1 (mr*mc);
for (int i = 0; i < nr; i++)
for (int j = 0; j < nc; j++)
tmp1(i+j*nr) = (double)a(i, j);
galois tmp2 (mr, mc, 0, a.m (), a.primpoly ());
for (int i = 0; i < mr; i++)
for (int j = 0; j < mc; j++)
tmp2(i, j) = (int)tmp1(i+j*mr);
retval = new octave_galois (tmp2);
}
}
return retval;
}
/*
%% Test input validation
%!error greshape ()
%!error greshape (1)
%!error greshape (1, 2, 3, 4)
*/
#define DATA_REDUCTION(FCN) \
\
octave_value_list retval; \
\
int nargin = args.length (); \
\
if (nargin == 1 || nargin == 2) \
{ \
octave_value arg = args(0); \
\
int dim = (nargin == 1 ? -1 : args(1).int_value (true) - 1); \
\
if (dim <= 1 && dim >= -1) \
{ \
if (galois_type_loaded && (arg.type_id () == \
octave_galois::static_type_id ())) \
{ \
galois tmp = ((const octave_galois&)arg.get_rep ()).galois_value (); \
\
retval(0) = new octave_galois (tmp.FCN (dim)); \
} \
else \
{ \
OCTAVE__ERR_WRONG_TYPE_ARG (#FCN, arg); \
return retval; \
} \
} \
else \
error (#FCN ": invalid dimension argument = %d", dim + 1); \
} \
else \
print_usage (); \
\
return retval
// PKG_ADD: autoload ("gprod", "gf.oct");
// PKG_DEL: autoload ("gprod", "gf.oct", "remove");
DEFUN_DLD (gprod, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} gprod (@var{x}, @var{dim})\n\
Product of elements along dimension @var{dim} of Galois array. If\n\
@var{dim} is omitted, it defaults to 1 (column-wise products).\n\
@seealso{prod}\n\
@end deftypefn")
{
DATA_REDUCTION (prod);
}
/*
%% Test input validation
%!error gprod ()
%!error gprod (1, 2, 3)
*/
// PKG_ADD: autoload ("gsum", "gf.oct");
// PKG_DEL: autoload ("gsum", "gf.oct", "remove");
DEFUN_DLD (gsum, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} gsum (@var{x}, @var{dim})\n\
Sum of elements along dimension @var{dim} of Galois array. If @var{dim}\n\
is omitted, it defaults to 1 (column-wise sum).\n\
@seealso{sum}\n\
@end deftypefn")
{
DATA_REDUCTION (sum);
}
/*
%% Test input validation
%!error gsum ()
%!error gsum (1, 2, 3)
*/
// PKG_ADD: autoload ("gsumsq", "gf.oct");
// PKG_DEL: autoload ("gsumsq", "gf.oct", "remove");
DEFUN_DLD (gsumsq, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} gsumsq (@var{x}, @var{dim})\n\
Sum of squares of elements along dimension @var{dim} of Galois array.\n\
If @var{dim} is omitted, it defaults to 1 (column-wise sum of squares).\n\
\n\
This function is equivalent to computing\n\
@example\n\
gsum (x .* conj (x), dim)\n\
@end example\n\
but it uses less memory.\n\
@seealso{sumsq}\n\
@end deftypefn")
{
DATA_REDUCTION (sumsq);
}
/*
%% Test input validation
%!error gsumsq ()
%!error gsumsq (1, 2, 3)
*/
// PKG_ADD: autoload ("gsqrt", "gf.oct");
// PKG_DEL: autoload ("gsqrt", "gf.oct", "remove");
DEFUN_DLD (gsqrt, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} gsqrt (@var{x})\n\
Compute the square root of @var{x}, element by element, in a Galois Field.\n\
@seealso{exp}\n\
@end deftypefn")
{
octave_value retval;
int nargin = args.length ();
if (nargin != 1)
{
print_usage ();
return retval;
}
if (!galois_type_loaded || (args(0).type_id () !=
octave_galois::static_type_id ()))
{
OCTAVE__ERR_WRONG_TYPE_ARG ("gsqrt", args(0));
return retval;
}
galois a = ((const octave_galois&) args(0).get_rep ()).galois_value ();
retval = new octave_galois (a.sqrt ());
return retval;
}
/*
%% Test input validation
%!error gsqrt ()
%!error gsqrt (1, 2)
*/
// PKG_ADD: autoload ("glog", "gf.oct");
// PKG_DEL: autoload ("glog", "gf.oct", "remove");
DEFUN_DLD (glog, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} glog (@var{x})\n\
Compute the natural logarithm for each element of @var{x} for a Galois\n\
array.\n\
@seealso{log}\n\
@end deftypefn")
{
octave_value retval;
int nargin = args.length ();
if (nargin != 1)
{
print_usage ();
return retval;
}
if (!galois_type_loaded || (args(0).type_id () !=
octave_galois::static_type_id ()))
{
OCTAVE__ERR_WRONG_TYPE_ARG ("glog", args(0));
return retval;
}
galois a = ((const octave_galois&) args(0).get_rep ()).galois_value ();
retval = new octave_galois (a.log ());
return retval;
}
/*
%% Test input validation
%!error glog ()
%!error glog (1, 2)
*/
// PKG_ADD: autoload ("gexp", "gf.oct");
// PKG_DEL: autoload ("gexp", "gf.oct", "remove");
DEFUN_DLD (gexp, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} gexp (@var{x})\n\
Compute the anti-logarithm for each element of @var{x} for a Galois\n\
array.\n\
@seealso{exp}\n\
@end deftypefn")
{
octave_value retval;
int nargin = args.length ();
if (nargin != 1)
{
print_usage ();
return retval;
}
if (!galois_type_loaded || (args(0).type_id () !=
octave_galois::static_type_id ()))
{
OCTAVE__ERR_WRONG_TYPE_ARG ("gexp", args(0));
return retval;
}
galois a = ((const octave_galois&) args(0).get_rep ()).galois_value ();
retval = new octave_galois (a.exp ());
return retval;
}
/*
%% Test input validation
%!error gexp ()
%!error gexp (1, 2)
*/
static inline int
modn (int x, int m, int n)
{
while (x >= n)
{
x -= n;
x = (x >> m) + (x & n);
}
return x;
}
galois
filter (galois& b, galois& a, galois& x, galois& si)
{
int ab_len = (a.numel () > b.numel () ? a.numel () : b.numel ());
b.resize (dim_vector (ab_len, 1), 0);
galois retval (x.numel (), 1, 0, b.m (), b.primpoly ());
int norm = a(0, 0);
if (norm == 0)
{
error ("gfilter: the first element of a must be non-zero");
return galois ();
}
if (si.numel () != ab_len - 1)
{
error ("gfilter: si must be a vector of length max(length(a), length(b)) - 1");
return galois ();
}
if (norm != 1)
{
int idx_norm = b.index_of (norm);
for (int i = 0; i < b.numel (); i++)
{
if (b(i, 0) != 0)
b(i, 0) = b.alpha_to (modn (b.index_of (b(i, 0))-idx_norm+b.n (),
b.m (), b.n ()));
}
}
if (a.numel () > 1)
{
a.resize (dim_vector (ab_len, 1), 0);
if (norm != 1)
{
int idx_norm = a.index_of (norm);
for (int i = 0; i < a.numel (); i++)
if (a(i, 0) != 0)
a(i, 0) = a.alpha_to (modn (a.index_of (a(i, 0))-idx_norm+a.n (),
a.m (), a.n ()));
}
for (int i = 0; i < x.numel (); i++)
{
retval(i, 0) = si(0, 0);
if ((b(0, 0) != 0) && (x(i, 0) != 0))
retval(i, 0) ^= b.alpha_to (modn (b.index_of (b(0, 0)) +
b.index_of (x(i, 0)), b.m (), b.n ()));
if (si.numel () > 1)
{
for (int j = 0; j < si.numel () - 1; j++)
{
si(j, 0) = si(j+1, 0);
if ((a(j+1, 0) != 0) && (retval(i, 0) != 0))
si(j, 0) ^= a.alpha_to (modn (a.index_of (a(j+1, 0)) +
a.index_of (retval(i, 0)), a.m (), a.n ()));
if ((b(j+1, 0) != 0) && (x(i, 0) != 0))
si(j, 0) ^= b.alpha_to (modn (b.index_of (b(j+1, 0)) +
b.index_of (x(i, 0)), b.m (), b.n ()));
}
si(si.numel ()-1, 0) = 0;
if ((a(si.numel (), 0) != 0) && (retval(i, 0) != 0))
si(si.numel ()-1, 0) ^= a.alpha_to (modn (a.index_of (a(si.numel (), 0))
+ a.index_of (retval(i, 0)),
a.m (), a.n ()));
if ((b(si.numel (), 0) != 0) && (x(i, 0) != 0))
si(si.numel ()-1, 0) ^= b.alpha_to (modn (b.index_of (b(si.numel (), 0))
+ b.index_of (x(i, 0)),
b.m (), b.n ()));
}
else
{
si(0, 0) = 0;
if ((a(1, 0) != 0) && (retval(i, 0) != 0))
si(0, 0) ^= a.alpha_to (modn (a.index_of (a(1, 0))+
a.index_of (retval(i, 0)), a.m (), a.n ()));
if ((b(1, 0) != 0) && (x(i, 0) != 0))
si(0, 0) ^= b.alpha_to (modn (b.index_of (b(1, 0))+
b.index_of (x(i, 0)), b.m (), b.n ()));
}
}
}
else if (si.numel () > 0)
{
for (int i = 0; i < x.numel (); i++)
{
retval(i, 0) = si(0, 0);
if ((b(0, 0) != 0) && (x(i, 0) != 0))
retval(i, 0) ^= b.alpha_to (modn (b.index_of (b(0, 0)) +
b.index_of (x(i, 0)), b.m (), b.n ()));
if (si.numel () > 1)
{
for (int j = 0; j < si.numel () - 1; j++)
{
si(j, 0) = si(j+1, 0);
if ((b(j+1, 0) != 0) && (x(i, 0) != 0))
si(j, 0) ^= b.alpha_to (modn (b.index_of (b(j+1, 0)) +
b.index_of (x(i, 0)), b.m (), b.n ()));
}
si(si.numel ()-1, 0) = 0;
if ((b(si.numel (), 0) != 0) && (x(i, 0) != 0))
si(si.numel ()-1, 0) ^= b.alpha_to (modn (b.index_of (b(si.numel (), 0))
+ b.index_of (x(i, 0)),
b.m (), b.n ()));
}
else
{
si(0, 0) = 0;
if ((b(1, 0) != 0) && (x(i, 0) != 0))
si(0, 0) ^= b.alpha_to (modn (b.index_of (b(1, 0)) +
b.index_of (x(i, 0)), b.m (), b.n ()));
}
}
}
else
for (int i = 0; i < x.numel (); i++)
if ((b(0, 0) != 0) && (x(i, 0) != 0))
retval(i, 0) = b.alpha_to (modn (b.index_of (b(0, 0)) +
b.index_of (x(i, 0)), b.m (), b.n ()));
return retval;
}
// PKG_ADD: autoload ("gfilter", "gf.oct");
// PKG_DEL: autoload ("gfilter", "gf.oct", "remove");
DEFUN_DLD (gfilter, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {y =} gfilter (@var{b}, @var{a}, @var{x})\n\
@deftypefnx {Loadable Function} {[@var{y}, @var{sf}] =} gfilter (@var{b}, @var{a}, @var{x}, @var{si})\n\
Digital filtering of vectors in a Galois Field. Returns the solution to\n\
the following linear, time-invariant difference equation over a Galois\n\
Field:\n\
@tex\n\
$$\n\
\\sum_{k=0}^N a_{k+1} y_{n-k} = \\sum_{k=0}^M b_{k+1} x_{n-k}, \\qquad\n\
1 \\le n \\le P\n\
$$\n\
@end tex\n\
@ifnottex\n\
\n\
@smallexample\n\
@group\n\
N M\n\
SUM a(k+1) y(n-k) = SUM b(k+1) x(n-k) for 1<=n<=length(x)\n\
k=0 k=0\n\
@end group\n\
@end smallexample\n\
@end ifnottex\n\
\n\
@noindent\n\
where\n\
@tex\n\
$a \\in \\Re^{N-1}$, $b \\in \\Re^{M-1}$, and $x \\in \\Re^P$.\n\
@end tex\n\
@ifnottex\n\
N=length(a)-1 and M=length(b)-1.\n\
@end ifnottex\n\
An equivalent form of this equation is:\n\
@tex\n\
$$\n\
y_n = -\\sum_{k=1}^N c_{k+1} y_{n-k} + \\sum_{k=0}^M d_{k+1} x_{n-k}, \\qquad\n\
1 \\le n \\le P\n\
$$\n\
@end tex\n\
@ifnottex\n\
\n\
@smallexample\n\
@group\n\
N M\n\
y(n) = - SUM c(k+1) y(n-k) + SUM d(k+1) x(n-k) for 1<=n<=length(x)\n\
k=1 k=0\n\
@end group\n\
@end smallexample\n\
@end ifnottex\n\
\n\
@noindent\n\
where\n\
@tex\n\
$c = a/a_1$ and $d = b/a_1$.\n\
@end tex\n\
@ifnottex\n\
c = a/a(1) and d = b/a(1).\n\
@end ifnottex\n\
\n\
If the fourth argument @var{si} is provided, it is taken as the initial\n\
state of the system and the final state is returned as @var{sf}. The\n\
state vector is a column vector whose length is equal to the length of\n\
the longest coefficient vector minus one. If @var{si} is not supplied,\n\
the initial state vector is set to all zeros.\n\
@seealso{filter}\n\
@end deftypefn")
{
octave_value_list retval;
int nargin = args.length ();
if (nargin < 3 || nargin > 4)
{
print_usage ();
return retval;
}
if (!galois_type_loaded)
{
error ("gfilter: wrong argument types");
return retval;
}
bool x_is_row_vector = (args(2).rows () == 1);
bool si_is_row_vector = (nargin == 4 && args(3).rows () == 1);
galois b, a, x, si;
bool ib=false, ia=false, ix = false, isi=false;
if (args(0).type_id () == octave_galois::static_type_id ())
{
b = ((const octave_galois&) args(0).get_rep ()).galois_value ();
ib = true;
}
if (args(1).type_id () == octave_galois::static_type_id ())
{
a = ((const octave_galois&) args(1).get_rep ()).galois_value ();
ia = true;
}
if (args(2).type_id () == octave_galois::static_type_id ())
{
x = ((const octave_galois&) args(2).get_rep ()).galois_value ();
ix = true;
}
if (nargin == 4)
{
if (args(3).type_id () == octave_galois::static_type_id ())
{
si = ((const octave_galois&) args(3).get_rep ()).galois_value ();
isi = true;
}
}
if (!ib && !ia && !ix && !isi)
{
error ("gfilter: wrong argument types");
return retval;
}
if (!ib)
{
if (ia)
b = galois (args(0).matrix_value (), a.m (), a.primpoly ());
else if (ix)
b = galois (args(0).matrix_value (), x.m (), x.primpoly ());
else if (isi)
b = galois (args(0).matrix_value (), si.m (), si.primpoly ());
}
if (!ia)
a = galois (args(1).matrix_value (), b.m (), b.primpoly ());
if (!ix)
x = galois (args(2).matrix_value (), b.m (), b.primpoly ());
if (nargin == 4)
{
if (!isi)
si = galois (args(3).matrix_value (), b.m (), b.primpoly ());
}
else
{
int a_len = a.numel ();
int b_len = b.numel ();
int si_len = (a_len > b_len ? a_len : b_len) - 1;
si = galois (si_len, 1, 0, b.m (), b.primpoly ());
}
if ((b.m () != a.m ()) || (b.m () != x.m ()) || (b.m () != si.m ()) ||
(b.primpoly () != a.primpoly ()) || (b.primpoly () != x.primpoly ()) ||
(b.primpoly () != si.primpoly ()))
{
error ("gfilter: arguments must be in same galois field");
return retval;
}
if (b.cols () > 1)
b = b.transpose ();
if (a.cols () > 1)
a = a.transpose ();
if (x.cols () > 1)
x = x.transpose ();
if (si.cols () > 1)
si = si.transpose ();
if (b.cols () > 1 || a.cols () > 1 || x.cols () > 1 || si.cols () > 1)
{
error ("gfilter: arguments must be vectors");
return retval;
}
galois y (filter (b, a, x, si));
if (nargout == 2)
{
if (si_is_row_vector)
retval(1) = new octave_galois (si.transpose ());
else
retval(1) = new octave_galois (si);
}
if (x_is_row_vector)
retval(0) = new octave_galois (y.transpose ());
else
retval(0) = new octave_galois (y);
return retval;
}
/*
%% Test input validation
%!error gfilter ()
%!error gfilter (1)
%!error gfilter (1, 2)
%!error gfilter (1, 2, 3, 4, 5)
*/
// PKG_ADD: autoload ("glu", "gf.oct");
// PKG_DEL: autoload ("glu", "gf.oct", "remove");
DEFUN_DLD (glu, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {[@var{l}, @var{u}, @var{p}] =} glu (@var{a})\n\
@cindex LU decomposition of Galois matrix\n\
Compute the LU decomposition of @var{a} in a Galois Field. The result is\n\
returned in a permuted form, according to the optional return value\n\
@var{p}. For example, given the matrix\n\
@code{a = gf ([1, 2; 3, 4], 3)},\n\
\n\
@example\n\
[l, u, p] = glu (a)\n\
@end example\n\
\n\
@noindent\n\
returns\n\
\n\
@example\n\
l =\n\
GF(2^3) array. Primitive Polynomial = D^3+D+1 (decimal 11)\n\
\n\
Array elements =\n\
\n\
1 0\n\
6 1\n\
\n\
u =\n\
GF(2^3) array. Primitive Polynomial = D^3+D+1 (decimal 11)\n\
\n\
Array elements =\n\
\n\
3 4\n\
0 7\n\
\n\
p =\n\
\n\
Permutation Matrix\n\
\n\
0 1\n\
1 0\n\
\n\
@end example\n\
\n\
Such that @code{@var{p} * @var{a} = @var{l} * @var{u}}. If the argument\n\
@var{p} is not included then the permutations are applied to @var{l}\n\
so that @code{@var{a} = @var{l} * @var{u}}. @var{l} is then a pseudo-\n\
lower triangular matrix. The matrix @var{a} can be rectangular.\n\
@seealso{lu}\n\
@end deftypefn")
{
octave_value_list retval;
int nargin = args.length ();
if (nargin != 1 || nargout > 3)
{
print_usage ();
return retval;
}
octave_value arg = args(0);
if (!galois_type_loaded || (arg.type_id () !=
octave_galois::static_type_id ()))
{
OCTAVE__ERR_WRONG_TYPE_ARG ("glu", arg);
return retval;
}
galois m = ((const octave_galois&) arg.get_rep ()).galois_value ();
int nr = arg.rows ();
int nc = arg.columns ();
int arg_is_empty = arg.OV_ISEMPTY();
if (arg_is_empty < 0)
return retval;
else if (arg_is_empty > 0)
{
retval(0) = new octave_galois (galois (0, 0, 0, m.m (), m.primpoly ()));
retval(1) = new octave_galois (galois (0, 0, 0, m.m (), m.primpoly ()));
retval(2) = new octave_galois (galois (0, 0, 0, m.m (), m.primpoly ()));
return retval;
}
galoisLU fact (m);
switch (nargout)
{
case 0:
case 1:
case 2:
{
// While we don't have sparse galois matrices converting the
// permutation matrix to a full matrix is the best we can do.
Matrix P = Matrix (fact.P ());
galois L = P.transpose () * fact.L ();
retval(1) = new octave_galois (fact.U ());
retval(0) = new octave_galois (L);
}
break;
case 3:
default:
retval(2) = fact.P ();
retval(1) = new octave_galois (fact.U ());
retval(0) = new octave_galois (fact.L ());
break;
}
return retval;
}
/*
%% Test input validation
%!error glu ()
%!error glu (1, 2)
*/
// PKG_ADD: autoload ("ginv", "gf.oct");
// PKG_DEL: autoload ("ginv", "gf.oct", "remove");
DEFUN_DLD (ginv, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {[@var{x}, @var{rcond}] =} ginv (@var{a})\n\
Compute the inverse of the square matrix @var{a}. Return an estimate\n\
of the reciprocal condition number if requested, otherwise warn of an\n\
ill-conditioned matrix if the reciprocal condition number is small.\n\
@seealso{inv}\n\
@end deftypefn")
{
octave_value_list retval;
int nargin = args.length ();
if (nargin != 1)
{
print_usage ();
return retval;
}
octave_value arg = args(0);
int nr = arg.rows ();
int nc = arg.columns ();
if (!galois_type_loaded || (arg.type_id () !=
octave_galois::static_type_id ()))
{
OCTAVE__ERR_WRONG_TYPE_ARG ("ginverse", arg);
return retval;
}
galois m = ((const octave_galois&) arg.get_rep ()).galois_value ();
int arg_is_empty = arg.OV_ISEMPTY ();
if (arg_is_empty < 0)
return retval;
else if (arg_is_empty > 0)
{
retval(0) = new octave_galois (galois (0, 0, 0, m.m (), m.primpoly ()));
return retval;
}
if (nr != nc)
{
OCTAVE__ERR_SQUARE_MATRIX_REQUIRED ("ginverse");
return retval;
}
int info;
double rcond = 0.0;
galois result = m.inverse (info, 1);
if (nargout > 1)
retval(1) = rcond;
retval(0) = new octave_galois (result);
if (nargout < 2 && info == -1)
warning ("inverse: matrix singular to machine precision, rcond = %g", rcond);
return retval;
}
/*
%% Test input validation
%!error ginv ()
%!error ginv (1, 2)
*/
// FIXME: this should really be done with an alias, but
// alias_builtin() won't do the right thing if we are actually using
// dynamic linking.
// PKG_ADD: autoload ("ginverse", "gf.oct");
// PKG_DEL: autoload ("ginverse", "gf.oct", "remove");
DEFUN_DLD (ginverse, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {} ginverse (@var{a})\n\
Compute the inverse of the square matrix @var{a}. Return an estimate\n\
of the reciprocal condition number if requested, otherwise warn of an\n\
ill-conditioned matrix if the reciprocal condition number is small.\n\
@seealso{ginv}\n\
@end deftypefn")
{
return Fginv (args, nargout);
}
/*
%% Test input validation
%!error ginverse ()
%!error ginverse (1, 2)
*/
// PKG_ADD: autoload ("gdet", "gf.oct");
// PKG_DEL: autoload ("gdet", "gf.oct", "remove");
DEFUN_DLD (gdet, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{d} =} gdet (@var{a})\n\
Compute the determinant of the Galois array @var{a}.\n\
@seealso{det}\n\
@end deftypefn")
{
octave_value retval;
int nargin = args.length ();
if (nargin != 1)
{
print_usage ();
return retval;
}
octave_value arg = args(0);
if (!galois_type_loaded || (arg.type_id () !=
octave_galois::static_type_id ()))
{
OCTAVE__ERR_WRONG_TYPE_ARG ("gdet", arg);
return retval;
}
int nr = arg.rows ();
int nc = arg.columns ();
galois m = ((const octave_galois&) arg.get_rep ()).galois_value ();
int arg_is_empty = arg.OV_ISEMPTY ();
if (arg_is_empty < 0)
return retval;
else if (arg_is_empty > 0)
{
retval = new octave_galois (galois (1, 1, 1, m.m (), m.primpoly ()));
return retval;
}
if (nr != nc)
{
OCTAVE__ERR_SQUARE_MATRIX_REQUIRED ("det");
return retval;
}
retval = new octave_galois (m.determinant ());
return retval;
}
/*
%% Test input validation
%!error gdet ()
%!error gdet (1, 2)
*/
// PKG_ADD: autoload ("grank", "gf.oct");
// PKG_DEL: autoload ("grank", "gf.oct", "remove");
DEFUN_DLD (grank, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{d} =} grank (@var{a})\n\
Compute the rank of the Galois array @var{a} by counting the independent\n\
rows and columns.\n\
@seealso{rank}\n\
@end deftypefn")
{
octave_value retval;
int nargin = args.length ();
if (nargin != 1)
{
print_usage ();
return retval;
}
octave_value arg = args(0);
if (!galois_type_loaded || (arg.type_id () !=
octave_galois::static_type_id ()))
{
OCTAVE__ERR_WRONG_TYPE_ARG ("grank", arg);
return retval;
}
int nr = arg.rows ();
int nc = arg.columns ();
galois m = ((const octave_galois&) arg.get_rep ()).galois_value ();
int arg_is_empty = arg.OV_ISEMPTY ();
if (arg_is_empty > 0)
retval = 0.0;
else if (arg_is_empty == 0)
{
int d = 0;
int mm = m.m ();
int mn = m.n ();
OCTAVE_LOCAL_BUFFER (int, ci, nr);
for (int i = 0; i < nc; i++)
{
int idx = -1;
int iel = 0;
for (int j = 0; j < nr; j++)
{
ci[j] = m.elem (j, i);
if (ci[j] != 0 && idx == -1)
{
iel = ci[j];
idx = j;
}
}
if (idx != -1)
{
d++;
int indx = m.index_of (iel);
for (int j = 0; j < nr; j++)
if (ci[j] != 0)
ci[j] = m.alpha_to (modn (m.index_of (ci[j]) - indx + mn, mm, mn));
for (int j = i+1; j < nc; j++)
{
if (m.elem (idx, j) != 0)
{
indx = m.index_of (m.elem (idx, j));
for (int k = 0; k < nr; k++)
if (ci[k] != 0)
m.elem (k, j) ^= m.alpha_to (modn (m.index_of (ci[k]) + indx +
mn, mm, mn));
}
}
}
}
retval = (double)d;
}
return retval;
}
/*
%% Test input validation
%!error grank ()
%!error grank (1, 2)
*/
// PKG_ADD: autoload ("rsenc", "gf.oct");
// PKG_DEL: autoload ("rsenc", "gf.oct", "remove");
DEFUN_DLD (rsenc, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{code} =} rsenc (@var{msg}, @var{n}, @var{k})\n\
@deftypefnx {Loadable Function} {@var{code} =} rsenc (@var{msg}, @var{n}, @var{k}, @var{g})\n\
@deftypefnx {Loadable Function} {@var{code} =} rsenc (@var{msg}, @var{n}, @var{k}, @var{fcr}, @var{prim})\n\
@deftypefnx {Loadable Function} {@var{code} =} rsenc (@dots{}, @var{parpos})\n\
Encodes the message @var{msg} using a [@var{n},@var{k}] Reed-Solomon coding.\n\
The variable @var{msg} is a Galois array with @var{k} columns and an arbitrary\n\
number of rows. Each row of @var{msg} represents a single block to be coded\n\
by the Reed-Solomon coder. The coded message is returned in the Galois\n\
array @var{code} containing @var{n} columns and the same number of rows as\n\
@var{msg}.\n\
\n\
The use of @code{rsenc} can be seen in the following short example.\n\
\n\
@example\n\
m = 3; n = 2^m -1; k = 3;\n\
msg = gf ([1 2 3; 4 5 6], m);\n\
code = rsenc (msg, n, k);\n\
@end example\n\
\n\
If @var{n} does not equal @code{2^@var{m}-1}, where m is an integer, then a\n\
shorten Reed-Solomon coding is used where zeros are added to the start of\n\
each row to obtain an allowable codeword length. The returned @var{code}\n\
has these prepending zeros stripped.\n\
\n\
By default the generator polynomial used in the Reed-Solomon coding is based\n\
on the properties of the Galois Field in which @var{msg} is given. This\n\
default generator polynomial can be overridden by a polynomial in @var{g}.\n\
Suitable generator polynomials can be constructed with @code{rsgenpoly}.\n\
@var{fcr} is an integer value, and it is taken to be the first consecutive\n\
root of the generator polynomial. The variable @var{prim} is then the\n\
primitive element used to construct the generator polynomial, such that\n\
@tex\n\
$g = (x - A^b) (x - A^{b+p}) \\cdots (x - A ^{b+2tp-1})$.\n\
@end tex\n\
@ifnottex\n\
\n\
@var{g} = (@var{x} - A^@var{b}) * (@var{x} - A^(@var{b}+@var{prim})) * ... * (@var{x} - A^(@var{b}+2*@var{t}*@var{prim}-1)).\n\
@end ifnottex\n\
\n\
where @var{b} is equal to @code{@var{fcr} * @var{prim}}. By default @var{fcr}\n\
and @var{prim} are both 1.\n\
\n\
By default the parity symbols are placed at the end of the coded message.\n\
The variable @var{parpos} controls this positioning and can take the values\n\
@code{\"beginning\"} or @code{\"end\"}.\n\
@seealso{gf, rsdec, rsgenpoly}\n\
@end deftypefn")
{
octave_value retval;
int nargin = args.length ();
if (nargin < 3 || nargin > 5)
{
print_usage ();
return retval;
}
if (!galois_type_loaded || (args(0).type_id () !=
octave_galois::static_type_id ()))
{
OCTAVE__ERR_WRONG_TYPE_ARG ("rsenc", args(0));
return retval;
}
galois msg = ((const octave_galois&) args(0).get_rep ()).galois_value ();
int nsym = msg.rows ();
int primpoly = msg.primpoly ();
int n = args(1).nint_value ();
int k = args(2).nint_value ();
int m = 1;
while (n > (1< __OCTAVE_GALOIS_MAX_M))
{
error ("rsenc: invalid values of message and codeword length");
return retval;
}
if ((n-k) & 1)
{
error ("rsenc: difference of message and codeword length must be even");
return retval;
}
int nroots = n-k;
galois genpoly;
bool have_genpoly = false;
bool parity_at_end = true;
int fcr = 0;
int prim = 0;
for (int i = 3; i < nargin; i++)
{
if (args(i).is_string ())
{
std::string parstr = args(i).string_value ();
for (int j = 0; j < (int)parstr.length (); j++)
parstr[j] = toupper (parstr[j]);
if (!parstr.compare("END"))
{
parity_at_end = true;
}
else if (!parstr.compare("BEGINNING"))
{
parity_at_end = false;
}
else
{
error ("rsenc: unrecoginized parity position");
return retval;
}
}
else
{
if (args(i).type_id () == octave_galois::static_type_id ())
{
if (have_genpoly)
{
print_usage ();
return retval;
}
genpoly = ((const octave_galois&) args(i).get_rep ()).galois_value ();
if (genpoly.cols () > genpoly.rows ())
genpoly = genpoly.transpose ();
}
else
{
if (have_genpoly)
{
if (prim != 0)
{
print_usage ();
return retval;
}
prim = args(i).nint_value ();
}
else
fcr = args(i).nint_value ();
}
have_genpoly = true;
}
}
if ((genpoly.rows () == 0) || (genpoly.cols () == 0))
{
if (fcr == 0)
fcr = 1;
if (prim == 0)
prim = 1;
// Create polynomial of right length.
genpoly = galois (nroots+1, 1, 0, m, primpoly);
genpoly(nroots, 0) = 1;
int i, root;
for (i = 0, root=fcr*prim; i < nroots; i++, root += prim)
{
genpoly(nroots-i-1, 0) = 1;
// Multiply genpoly by @**(root + x)
for (int j = i; j > 0; j--)
{
int k = nroots - j;
if (genpoly(k, 0) != 0)
genpoly(k, 0) = genpoly(k+1, 0)
^ genpoly.alpha_to (modn (genpoly.index_of (genpoly(k, 0))
+ root, m, n));
else
genpoly(k, 0) = genpoly(k+1, 0);
}
// genpoly(nroots,0) can never be zero
genpoly(nroots, 0) = genpoly.alpha_to (modn (genpoly.index_of (genpoly(nroots, 0))
+ root, m, n));
}
}
else
{
if (genpoly.cols () != 1)
{
error ("rsenc: the generator polynomial must be a vector");
return retval;
}
if (genpoly.primpoly () != primpoly)
{
error ("rsenc: the generator polynomial must be same galois field "
"as the message");
return retval;
}
if (genpoly.rows () != nroots+1)
{
error ("rsenc: generator polynomial has incorrect order");
return retval;
}
}
int norm = genpoly(0, 0);
// Take logarithm of generator polynomial, for faster coding
for (int i = 0; i < nroots+1; i++)
genpoly(i, 0) = genpoly.index_of (genpoly(i, 0));
// Add space for parity block
msg.resize (dim_vector (nsym, n), 0);
// The code below basically finds the parity bits by treating the
// message as a polynomial and dividing it by the generator polynomial.
// The parity bits are then the remainder of this division. If the parity
// is at the end the polynomial is treat MSB first, otherwise it is
// treated LSB first
//
// This code could just as easily be written as
// [ignore par] = gdeconv(msg, genpoly);
// But the code below has the advantage of being 20 times faster :-)
if (parity_at_end)
{
for (int l = 0; l < nsym; l++)
{
galois par (nroots, 1, 0, m, primpoly);
for (int i = 0; i < k; i++)
{
int feedback = par.index_of (par(0, 0) ^ msg(l, i));
if (feedback != nn)
{
if (norm != 1)
feedback = modn (nn-genpoly(0, 0)+feedback, m, nn);
for (int j = 1; j < nroots; j++)
par(j, 0) ^= par.alpha_to (modn (feedback +
genpoly(j, 0), m, nn));
}
for (int j = 1; j < nroots; j++)
par(j-1, 0) = par(j, 0);
if (feedback != nn)
par(nroots-1, 0) = par.alpha_to (modn (feedback+
genpoly(nroots, 0), m, nn));
else
par(nroots-1, 0) = 0;
}
for (int j = 0; j < nroots; j++)
msg(l, k+j) = par(j, 0);
}
}
else
{
for (int l = 0; l < nsym; l++)
{
for (int i=k; i > 0; i--)
msg(l, i+nroots-1) = msg(l, i-1);
for (int i = 0; i nroots; i--)
{
int feedback = par.index_of (par(0, 0) ^ msg(l, i-1));
if (feedback != nn)
{
if (norm != 1)
feedback = modn (nn-genpoly(0, 0)+feedback, m, nn);
for (int j = 1; j < nroots; j++)
par(j, 0) ^= par.alpha_to (modn (feedback +
genpoly(j, 0), m, nn));
}
for (int j = 1; j < nroots; j++)
par(j-1, 0) = par(j, 0);
if (feedback != nn)
par(nroots-1, 0) = par.alpha_to (modn (feedback+
genpoly(nroots, 0), m, nn));
else
par(nroots-1, 0) = 0;
}
for (int j = 0; j < nroots; j++)
msg(l, j) = par(nroots-j-1, 0);
}
}
retval = new octave_galois (msg);
return retval;
}
/*
%% Test input validation
%!error rsenc ()
%!error rsenc (1)
%!error rsenc (1, 2)
%!error rsenc (1, 2, 3, 4, 5, 6)
*/
int
decode_rs(galois& data, const int prim, const int iprim, const int nroots,
const int fcr, const int drow, const bool msb_first)
{
int deg_lambda, el, deg_omega;
int i, j, r, k;
int q, tmp, num1, num2, den, discr_r;
int syn_error, count;
int m = data.m ();
int n = data.n ();
int A0 = n;
/* Err Locator and syndrome poly */
OCTAVE_LOCAL_BUFFER (int, lambda, nroots+1);
OCTAVE_LOCAL_BUFFER (int, s, nroots);
OCTAVE_LOCAL_BUFFER (int, b, nroots+1);
OCTAVE_LOCAL_BUFFER (int, t, nroots+1);
OCTAVE_LOCAL_BUFFER (int, omega, nroots+1);
OCTAVE_LOCAL_BUFFER (int, root, nroots);
OCTAVE_LOCAL_BUFFER (int, reg, nroots+1);
OCTAVE_LOCAL_BUFFER (int, loc, nroots);
/* form the syndromes; i.e., evaluate data(x) at roots of g(x) */
if (msb_first)
{
for (i = 0; i < nroots; i++)
s[i] = data(drow, 0);
for (j = 1; j < n; j++)
for (i = 0; i0; j--)
for (i = 0; i < nroots; i++)
if(s[i] == 0)
s[i] = data(drow, j-1);
else
s[i] = data(drow, j-1) ^ data.alpha_to (modn (data.index_of (s[i]) +
(fcr+i)*prim, m, n));
}
/* Convert syndromes to index form, checking for nonzero condition */
syn_error = 0;
for (i = 0; i < nroots; i++)
{
syn_error |= s[i];
s[i] = data.index_of (s[i]);
}
if (!syn_error)
/* if syndrome is zero, data(drow,:) is a codeword and there are no
* errors to correct. So return data(drow,:) unmodified
*/
return 0;
memset(&lambda[1], 0, nroots*sizeof (lambda[0]));
lambda[0] = 1;
for (i = 0; i < nroots+1; i++)
b[i] = data.index_of (lambda[i]);
/*
* Begin Berlekamp-Massey algorithm to determine error locator polynomial
*/
r = 0;
el = 0;
while (++r <= nroots)
{/* r is the step number */
/* Compute discrepancy at the r-th step in poly-form */
discr_r = 0;
for (i = 0; i < r; i++)
{
if ((lambda[i] != 0) && (s[r-i-1] != A0))
{
discr_r ^= data.alpha_to (modn (data.index_of (lambda[i]) +
s[r-i-1], m, n));
}
}
discr_r = data.index_of (discr_r); /* Index form */
if (discr_r == A0)
{
/* 2 lines below: B(x) <-- x*B(x) */
memmove(&b[1], b, nroots*sizeof (b[0]));
b[0] = A0;
}
else
{
/* 7 lines below: T(x) <-- lambda(x) - discr_r*x*b(x) */
t[0] = lambda[0];
for (i = 0 ; i < nroots; i++)
{
if(b[i] != A0)
t[i+1] = lambda[i+1] ^ data.alpha_to (modn (discr_r + b[i], m, n));
else
t[i+1] = lambda[i+1];
}
if (2 * el <= r - 1)
{
el = r - el;
/*
* 2 lines below: B(x) <-- inv(discr_r) *
* lambda(x)
*/
for (i = 0; i <= nroots; i++)
b[i] = (lambda[i] == 0) ? A0 : modn (data.index_of (lambda[i]) -
discr_r + n, m, n);
}
else
{
/* 2 lines below: B(x) <-- x*B(x) */
memmove(&b[1], b, nroots*sizeof (b[0]));
b[0] = A0;
}
memcpy(lambda, t, (nroots+1)*sizeof (t[0]));
}
}
/* Convert lambda to index form and compute deg(lambda(x)) */
deg_lambda = 0;
for (i = 0; i < nroots+1; i++)
{
lambda[i] = data.index_of (lambda[i]);
if(lambda[i] != A0)
deg_lambda = i;
}
/* Find roots of the error locator polynomial by Chien search */
memcpy(®[1], &lambda[1], nroots*sizeof (reg[0]));
count = 0; /* Number of roots of lambda(x) */
for (i = 1, k = iprim-1; i <= n; i++, k = modn (k+iprim, m, n))
{
q = 1; /* lambda[0] is always 0 */
for (j = deg_lambda; j > 0; j--)
{
if (reg[j] != A0)
{
reg[j] = modn (reg[j] + j, m, n);
q ^= data.alpha_to (reg[j]);
}
}
if (q != 0)
continue; /* Not a root */
/* store root (index-form) and error location number */
root[count] = i;
loc[count] = k;
/* If we've already found max possible roots,
* abort the search to save time
*/
if(++count == deg_lambda)
break;
}
if (deg_lambda != count)
{
/*
* deg(lambda) unequal to number of roots => uncorrectable
* error detected
*/
return -1;
}
/*
* Compute err evaluator poly omega(x) = s(x)*lambda(x) (modulo
* x**nroots). in index form. Also find deg(omega).
*/
deg_omega = 0;
for (i = 0; i < nroots; i++)
{
tmp = 0;
j = (deg_lambda < i) ? deg_lambda : i;
for (; j >= 0; j--)
{
if ((s[i - j] != A0) && (lambda[j] != A0))
tmp ^= data.alpha_to (modn (s[i - j] + lambda[j], m, n));
}
if(tmp != 0)
deg_omega = i;
omega[i] = data.index_of (tmp);
}
omega[nroots] = A0;
/*
* Compute error values in poly-form. num1 = omega(inv(X(l))), num2 =
* inv(X(l))**(fcr-1) and den = lambda_pr(inv(X(l))) all in poly-form
*/
for (j = count-1; j >= 0; j--)
{
num1 = 0;
for (i = deg_omega; i >= 0; i--)
{
if (omega[i] != A0)
num1 ^= data.alpha_to (modn (omega[i] + i * root[j], m, n));
}
num2 = data.alpha_to (modn (root[j] * (fcr - 1) + n, m, n));
den = 0;
/* lambda[i+1] for i even is the formal deriv lambda_pr of lambda[i] */
for (i = (deg_lambda < nroots-1 ? deg_lambda : nroots-1) & ~1; i >= 0;
i -=2)
{
if(lambda[i+1] != A0)
den ^= data.alpha_to (modn (lambda[i+1] + i * root[j], m, n));
}
if (den == 0)
{
count = -1;
break;
}
/* Apply error to data */
if (num1 != 0)
{
if (msb_first)
data(drow, loc[j]) ^= data.alpha_to (modn (data.index_of (num1)
+ data.index_of (num2)
+ n - data.index_of (den),
m, n));
else
data(drow, n-loc[j]-1) ^= data.alpha_to (modn (data.index_of (num1)
+ data.index_of (num2)
+ n - data.index_of (den),
m, n));
}
}
return count;
}
// PKG_ADD: autoload ("rsdec", "gf.oct");
// PKG_DEL: autoload ("rsdec", "gf.oct", "remove");
DEFUN_DLD (rsdec, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{msg} =} rsdec (@var{code}, @var{n}, @var{k})\n\
@deftypefnx {Loadable Function} {@var{msg} =} rsdec (@var{code}, @var{n}, @var{k}, @var{g})\n\
@deftypefnx {Loadable Function} {@var{msg} =} rsdec (@var{code}, @var{n}, @var{k}, @var{fcr}, @var{prim})\n\
@deftypefnx {Loadable Function} {@var{msg} =} rsdec (@dots{}, @var{parpos})\n\
@deftypefnx {Loadable Function} {[@var{msg}, @var{nerr}] =} rsdec (@dots{})\n\
@deftypefnx {Loadable Function} {[@var{msg}, @var{nerr}, @var{ccode}] =} rsdec (@dots{})\n\
Decodes the message contained in @var{code} using a [@var{n},@var{k}]\n\
Reed-Solomon code. The variable @var{code} must be a Galois array with\n\
@var{n} columns and an arbitrary number of rows. Each row of @var{code}\n\
represents a single block to be decoded by the Reed-Solomon coder. The\n\
decoded message is returned in the variable @var{msg} containing @var{k}\n\
columns and the same number of rows as @var{code}.\n\
\n\
If @var{n} does not equal @code{2^@var{m}-1}, where m is an integer, then a\n\
shorten Reed-Solomon decoding is used where zeros are added to the start of\n\
each row to obtain an allowable codeword length. The returned @var{msg}\n\
has these prepending zeros stripped.\n\
\n\
By default the generator polynomial used in the Reed-Solomon coding is based\n\
on the properties of the Galois Field in which @var{msg} is given. This\n\
default generator polynomial can be overridden by a polynomial in @var{g}.\n\
Suitable generator polynomials can be constructed with @code{rsgenpoly}.\n\
@var{fcr} is an integer value, and it is taken to be the first consecutive\n\
root of the generator polynomial. The variable @var{prim} is then the\n\
primitive element used to construct the generator polynomial. By default\n\
@var{fcr} and @var{prim} are both 1. It is significantly faster to specify\n\
the generator polynomial in terms of @var{fcr} and @var{prim}, since @var{g}\n\
is converted to this form in any case.\n\
\n\
By default the parity symbols are placed at the end of the coded message.\n\
The variable @var{parpos} controls this positioning and can take the values\n\
@code{\"beginning\"} or @code{\"end\"}. If the parity symbols are at the end, the message is\n\
treated with the most-significant symbol first, otherwise the message is\n\
treated with the least-significant symbol first.\n\
@seealso{gf, rsenc, rsgenpoly}\n\
@end deftypefn")
{
octave_value_list retval;
int nargin = args.length ();
if (nargin < 3 || nargin > 5)
{
print_usage ();
return retval;
}
if (!galois_type_loaded || (args(0).type_id () !=
octave_galois::static_type_id ()))
{
OCTAVE__ERR_WRONG_TYPE_ARG ("rsdec", args(0));
return retval;
}
galois code = ((const octave_galois&) args(0).get_rep ()).galois_value ();
int nsym = code.rows ();
int primpoly = code.primpoly ();
int n = args(1).nint_value ();
int k = args(2).nint_value ();
int m = 1;
while (n > (1< __OCTAVE_GALOIS_MAX_M))
{
error ("rsdec: invalid values of message and codeword length");
return retval;
}
if ((n-k) & 1)
{
error ("rsdec: difference of message and codeword length must be even");
return retval;
}
int nroots = n-k;
galois genpoly;
bool have_genpoly = false;
bool parity_at_end = true;
int fcr = 0;
int prim = 0;
int iprim;
for (int i = 3; i < 6; i++)
{
if (nargin > i)
{
if (args(i).is_string ())
{
std::string parstr = args(i).string_value ();
for (int j = 0; j < (int)parstr.length (); j++)
parstr[j] = toupper (parstr[j]);
if (!parstr.compare("END"))
{
parity_at_end = true;
}
else if (!parstr.compare("BEGINNING"))
{
parity_at_end = false;
}
else
{
error ("rsdec: unrecoginized parrity position");
return retval;
}
}
else
{
if (args(i).type_id () == octave_galois::static_type_id ())
{
if (have_genpoly)
{
print_usage ();
return retval;
}
genpoly = ((const octave_galois&) args(i).get_rep ()).galois_value ();
}
else
{
if (have_genpoly)
{
if (prim != 0)
{
print_usage ();
return retval;
}
prim = args(i).nint_value ();
}
else
fcr = args(i).nint_value ();
}
have_genpoly = true;
}
}
}
if (have_genpoly)
{
if (fcr != 0)
{
if ((fcr < 1) || (fcr > nn))
{
error ("rsdec: invalid first consecutive root of generator polynomial");
return retval;
}
if ((prim < 1) || (prim > nn))
{
error ("rsdec: invalid primitive element of generator polynomial");
return retval;
}
}
else
{
if (genpoly.cols () > genpoly.rows ())
genpoly = genpoly.transpose ();
if (genpoly.cols () != 1)
{
error ("rsdec: the generator polynomial must be a vector");
return retval;
}
if (genpoly.primpoly () != primpoly)
{
error ("rsdec: the generator polynomial must be same galois "
"field as the message");
return retval;
}
if (genpoly.rows () != nroots+1)
{
error ("rsdec: generator polynomial has incorrect order");
return retval;
}
// Find the roots of the generator polynomial
int count = 0;
OCTAVE_LOCAL_BUFFER (int, roots, nroots);
for (int j = 0; j <= nn; j++)
{
// Evaluate generator polynomial at j
int val = genpoly(0, 0);
int indx = genpoly.index_of (j);
for (int i = 0; i 0; i--)
code(l, i+nn-n-1) = code(l, i-1);
}
for (int l = 0; l < nsym; l++)
nerr(l) = decode_rs (code, prim, iprim, nroots, fcr, l, parity_at_end);
if (nn != n)
{
if (parity_at_end)
for (int l = 0; l < nsym; l++)
for (int i = 0; i > n; i--)
code(l, i) = code(l, i+nn-n);
code.resize (dim_vector (nsym, n), 0);
}
if (parity_at_end)
{
for (int l = 0; l < nsym; l++)
for (int i = 0; i < k; i++)
msg(l, i) = code(l, i);
}
else
{
for (int l = 0; l < nsym; l++)
for (int i = 0; i < k; i++)
msg(l, i) = code(l, nroots+i);
}
retval(0) = new octave_galois (msg);
retval(1) = octave_value (nerr);
retval(2) = new octave_galois (code);
return retval;
}
/*
%% Test input validation
%!error rsdec ()
%!error rsdec (1)
%!error rsdec (1, 2)
%!error rsdec (1, 2, 3, 4, 5, 6)
*/
// PKG_ADD: autoload ("bchenco", "gf.oct");
// PKG_DEL: autoload ("bchenco", "gf.oct", "remove");
DEFUN_DLD (bchenco, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{code} =} bchenco (@var{msg}, @var{n}, @var{k})\n\
@deftypefnx {Loadable Function} {@var{code} =} bchenco (@var{msg}, @var{n}, @var{k}, @var{g})\n\
@deftypefnx {Loadable Function} {@var{code} =} bchenco (@dots{}, @var{parpos})\n\
Encodes the message @var{msg} using a [@var{n},@var{k}] BCH coding.\n\
The variable @var{msg} is a binary array with @var{k} columns and an\n\
arbitrary number of rows. Each row of @var{msg} represents a single symbol\n\
to be coded by the BCH coder. The coded message is returned in the binary\n\
array @var{code} containing @var{n} columns and the same number of rows as\n\
@var{msg}.\n\
\n\
The use of @code{bchenco} can be seen in the following short example.\n\
\n\
@example\n\
m = 3; n = 2^m - 1; k = 4;\n\
msg = randint (10, k);\n\
code = bchenco (msg, n, k);\n\
@end example\n\
\n\
Valid codes can be found using @code{bchpoly}. In general the codeword\n\
length @var{n} should be of the form @code{2^@var{m}-1}, where m is an\n\
integer. However, shortened BCH codes can be used such that if\n\
@code{[2^@var{m}-1,@var{k}]} is a valid code\n\
@code{[2^@var{m}-1-@var{x},@var{k}-@var{x}]}\n is also a valid code using\n\
the same generator polynomial.\n\
\n\
By default the generator polynomial used in the BCH coding is\n\
based on the properties of the Galois Field GF(2^@var{m}). This\n\
default generator polynomial can be overridden by a polynomial in @var{g}.\n\
Suitable generator polynomials can be constructed with @code{bchpoly}.\n\
\n\
By default the parity symbols are placed at the beginning of the coded\n\
message. The variable @var{parpos} controls this positioning and can take\n\
the values @code{\"beginning\"} or @code{\"end\"}.\n\
@seealso{bchpoly, bchdeco, encode}\n\
@end deftypefn")
{
octave_value retval;
int nargin = args.length ();
if (nargin < 3 || nargin > 5)
{
print_usage ();
return retval;
}
Matrix msg = args(0).matrix_value ();
int nsym = msg.rows ();
int nn = args(1).nint_value ();
int k = args(2).nint_value ();
int m = 1;
while (nn > (1< __OCTAVE_GALOIS_MAX_M))
{
error ("bchenco: invalid values of message or codeword length");
return retval;
}
galois genpoly;
bool have_genpoly = false;
bool parity_at_end = false;
for (int i = 3; i < nargin; i++)
{
if (args(i).is_string ())
{
std::string parstr = args(i).string_value ();
for (int j = 0; j < (int)parstr.length (); j++)
parstr[j] = toupper (parstr[j]);
if (!parstr.compare("END"))
{
parity_at_end = true;
}
else if (!parstr.compare("BEGINNING"))
{
parity_at_end = false;
}
else
{
error ("bchenco: unrecoginized parity position");
return retval;
}
}
else
{
have_genpoly = true;
genpoly = galois (args(i).matrix_value (), m);
if (genpoly.cols () > genpoly.rows ())
genpoly = genpoly.transpose ();
if (genpoly.cols () != 1)
{
error ("bchenco: the generator polynomial must be a vector");
return retval;
}
if (genpoly.rows () != nn-k+1)
{
error ("bchenco: generator polynomial has incorrect order");
return retval;
}
}
}
if (!have_genpoly)
{
// The code below is basically bchpoly.m in C++, so if there is a need
// it can be used to rewrite bchpoly as an oct-file...
RowVector found (n, 0);
found(0) = 1;
galois c (1, m, 0, m);
c(0, 0) = c.index_of (1);
Array cs (dim_vector (1, 1), 1);
int nc = 1;
// Find the cyclotomic cosets of GF(2^m)
while (found.min () == 0)
{
int idx = n;
for (int i = 0; i idx)
{
c(nc, cs(nc)) = r;
found(c.alpha_to (r)-1) = 1;
cs(nc) += 1;
}
nc++;
}
// Re-use the found vector with 1==not-found !!!
found.resize (nc);
galois f (1, 0, 0, m);
int t = 0;
int nf = 0;
do
{
t++;
for (int i = 0; i < nc; i++)
{
if (found(i) == 1)
{
for (int j = 2*(t-1); j<2*t; j++)
{
int flag = 0;
for (int l = 0; l < cs(i); l++)
{
if (c(i, l) == j+1)
{
f.resize (dim_vector (1, nf+cs(i)));
for (int ll = 0; ll < cs(i); ll++)
f(0, nf+ll) = c(i, ll);
found(i) = 0;
nf += cs(i);
flag = 1;
break;
}
}
if (flag) break;
}
}
}
}
while (nf < nn - k);
if (nf != nn - k)
{
error ("bchenco: can not find valid generator polynomial for parameters");
return retval;
}
// Create polynomial of right length.
genpoly = galois (nf+1, 1, 0, m);
genpoly(0, 0) = 1;
for (int i = 0; i < nf; i++)
{
genpoly(i+1, 0) = 1;
// Multiply genpoly by @**(root + x)
for (int l = i; l > 0; l--)
{
if (genpoly(l, 0) != 0)
genpoly(l, 0) = genpoly(l-1, 0)
^ genpoly.alpha_to (modn (genpoly.index_of (genpoly(l, 0)) + f(0, i),
m, n));
else
genpoly(l, 0) = genpoly(l-1, 0);
}
// genpoly(0,0) can never be zero
genpoly(0, 0) = genpoly.alpha_to (modn (genpoly.index_of (genpoly(0, 0))
+ f(0, i),
m, n));
}
}
// Add space for parity block
msg.resize (nsym, nn, 0);
// The code below basically finds the parity bits by treating the
// message as a polynomial and dividing it by the generator polynomial.
// The parity bits are then the remainder of this division.
//
// This code could just as easily be written as
// [ignore par] = gdeconv(gf(msg), gf(genpoly));
// But the code below has the advantage of being 20 times faster :-)
if (parity_at_end)
{
for (int l = 0; l < nsym; l++)
{
for (int i = 0; i < k; i++)
{
int feedback = (int)msg(l, i) ^ (int)msg(l, k);
if (feedback != 0)
{
for (int j = 0; j < nn-k-1; j++)
if (genpoly(nn-k-j-1, 0) != 0)
msg(l, k+j) = (int)msg(l, k+j+1) ^ feedback;
else
msg(l, k+j) = msg(l, k+j+1);
msg(l, nn-1) = genpoly(0, 0) & feedback;
}
else
{
for (int j = k; j < nn-1; j++)
msg(l, j) = msg(l, j+1);
msg(l, nn-1) = 0;
}
}
}
}
else
{
for (int l = 0; l < nsym; l++)
{
for (int i=k; i > 0; i--)
msg(l, i+nn-k-1) = msg(l, i-1);
for (int i = 0; i= 0; i--)
{
int feedback = (int)msg(l, nn-k+i) ^ (int)msg(l, nn-k-1);
if (feedback != 0)
{
for (int j = nn - k -1; j > 0; j--)
if (genpoly(j, 0) != 0)
msg(l, j) = (int)msg(l, j-1) ^ feedback;
else
msg(l, j) = msg(l, j-1);
msg(l, 0) = genpoly(0, 0) & feedback;
}
else
{
for (int j = nn - k - 1; j > 0; j--)
msg(l, j) = msg(l, j-1);
msg(l, 0) = 0;
}
}
}
}
retval = msg;
return retval;
}
/*
%% Test input validation
%!error bchenco ()
%!error bchenco (1)
%!error bchenco (1, 2)
%!error bchenco (1, 2, 3, 4, 5, 6)
*/
// PKG_ADD: autoload ("bchdeco", "gf.oct");
// PKG_DEL: autoload ("bchdeco", "gf.oct", "remove");
DEFUN_DLD (bchdeco, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{msg} =} bchdeco (@var{code}, @var{k}, @var{t})\n\
@deftypefnx {Loadable Function} {@var{msg} =} bchdeco (@var{code}, @var{k}, @var{t}, @var{prim})\n\
@deftypefnx {Loadable Function} {@var{msg} =} bchdeco (@dots{}, @var{parpos})\n\
@deftypefnx {Loadable Function} {[@var{msg}, @var{err}] =} bchdeco (@dots{})\n\
@deftypefnx {Loadable Function} {[@var{msg}, @var{err}, @var{ccode}] =} bchdeco (@dots{})\n\
Decodes the coded message @var{code} using a BCH coder. The message length\n\
of the coder is defined in variable @var{k}, and the error correction\n\
capability of the code is defined in @var{t}.\n\
\n\
The variable @var{code} is a binary array with @var{n} columns and an\n\
arbitrary number of rows. Each row of @var{code} represents a single symbol\n\
to be decoded by the BCH coder. The decoded message is returned in the\n\
binary array @var{msg} containing @var{k} columns and the same number of\n\
rows as @var{code}.\n\
\n\
The use of @code{bchdeco} can be seen in the following short example.\n\
\n\
@example\n\
m = 3; n = 2^m - 1; k = 4; t = 1;\n\
msg = randint (10, k);\n\
code = bchenco (msg, n, k);\n\
noisy = mod (randerr (10,n) + code, 2);\n\
[dec, err] = bchdeco (noisy, k, t);\n\
@end example\n\
\n\
Valid codes can be found using @code{bchpoly}. In general the codeword\n\
length @var{n} should be of the form @code{2^@var{m}-1}, where m is an\n\
integer. However, shortened BCH codes can be used such that if\n\
@code{[2^@var{m}-1,@var{k}]} is a valid code\n\
@code{[2^@var{m}-1-@var{x},@var{k}-@var{x}]}\n is also a valid code using\n\
the same generator polynomial.\n\
\n\
By default the BCH coding is based on the properties of the Galois\n\
Field GF(2^@var{m}). The primitive polynomial used in the Galois\n\
can be overridden by a primitive polynomial in @var{prim}. Suitable\n\
primitive polynomials can be constructed with @code{primpoly}. The form\n\
of @var{prim} may be either a integer representation of the primitive\n\
polynomial as given by @code{primpoly}, or a binary representation that\n\
might be constructed like\n\
\n\
@example\n\
m = 3;\n\
prim = de2bi (primpoly (m));\n\
@end example\n\
\n\
By default the parity symbols are assumed to be placed at the beginning of\n\
the coded message. The variable @var{parpos} controls this positioning and\n\
can take the values @code{\"beginning\"} or @code{\"end\"}.\n\
@seealso{bchpoly, bchenco, decode, primpoly}\n\
@end deftypefn")
{
octave_value_list retval;
int nargin = args.length ();
if (nargin < 3 || nargin > 5)
{
print_usage ();
return retval;
}
Matrix code = args(0).matrix_value ();
int nsym = code.rows ();
int nn = code.cols ();
int k = args(1).nint_value ();
int t = args(2).nint_value ();
int t2 = t << 1;
int m = 1;
while (nn > (1< __OCTAVE_GALOIS_MAX_M))
{
error ("bchdeco: invalid values of message or codeword length");
return retval;
}
int prim = 0; // primitve polynomial of zero flags default
bool parity_at_end = false;
for (int i = 3; i < nargin; i++)
{
if (args(i).is_string ())
{
std::string parstr = args(i).string_value ();
for (int j = 0; j < (int)parstr.length (); j++)
parstr[j] = toupper (parstr[j]);
if (!parstr.compare("END"))
{
parity_at_end = true;
}
else if (!parstr.compare("BEGINNING"))
{
parity_at_end = false;
}
else
{
error ("bchdeco: unrecoginized parity position");
return retval;
}
}
else
{
if (args(i).is_real_scalar ())
prim = args(i).int_value ();
else
{
Matrix tmp = args(i).matrix_value ();
if (tmp.cols () > tmp.rows ())
tmp = tmp.transpose ();
if (tmp.cols () != 1)
{
error ("bchdeco: the primitve polynomial must be a scalar "
"or a vector");
return retval;
}
prim = 0;
for (int i = 0; i < tmp.rows (); i++)
if ((int)tmp(i, 0) & 1)
prim |= (1< s (dim_vector(t2+1, 1), 0);
bool syn_error = false;
for (int i = 1; i <= t2; i++)
{
for (int j = 0; j < nn; j++)
{
if (parity_at_end)
{
if (code(lsym, nn-j-1) != 0)
s(i) ^= tables.alpha_to (modn (i*j, m, n));
}
else
{
if (code(lsym, j) != 0)
s(i) ^= tables.alpha_to (modn (i*j, m, n));
}
}
if (s(i) != 0)
syn_error = true; /* set error flag if non-zero syndrome */
}
if (syn_error)
{ /* if there are errors, try to correct them */
int q, u;
Array d (dim_vector (t2+2, 1)), l(dim_vector (t2+2, 1)),
u_lu(dim_vector (t2+2, 1)), reg(dim_vector (t2+2, 1)),
elp(dim_vector (t2+2, t2+2));
/* convert syndrome from polynomial form to index form */
for (int i = 1; i <= t2; i++)
s(i) = tables.index_of (s(i));
/*
* Compute the error location polynomial via the Berlekamp
* iterative algorithm. Following the terminology of Lin and
* Costello's book : d(u) is the 'mu'th discrepancy, where
* u='mu'+1 and 'mu' (the Greek letter!) is the step number
* ranging from -1 to 2*t (see L&C), l(u) is the degree of
* the elp at that step, and u_l(u) is the difference between
* the step number and the degree of the elp.
*/
/* initialise table entries */
d(0) = 0; /* index form */
d(1) = s(1); /* index form */
elp(0, 0) = 0; /* index form */
elp(1, 0) = 1; /* polynomial form */
for (int i = 1; i < t2; i++)
{
elp(0, i) = n; /* index form */
elp(1, i) = 0; /* polynomial form */
}
l(0) = 0;
l(1) = 0;
u_lu(0) = -1;
u_lu(1) = 0;
u = 0;
do
{
u++;
if (d(u) == n)
{
l(u + 1) = l(u);
for (int i = 0; i <= l(u); i++)
{
elp(u + 1, i) = elp(u, i);
elp(u, i) = tables.index_of (elp(u, i));
}
}
else
/*
* search for words with greatest u_lu(q) for
* which d(q)!=0
*/
{
q = u - 1;
while ((d(q) == n) && (q > 0))
q--;
/* have found first non-zero d(q) */
if (q > 0)
{
int j = q;
do
{
j--;
if ((d(j) != n) && (u_lu(q) < u_lu(j)))
q = j;
}
while (j > 0);
}
/*
* have now found q such that d(u)!=0 and
* u_lu(q) is maximum
*/
/* store degree of new elp polynomial */
if (l(u) > l(q) + u - q)
l(u + 1) = l(u);
else
l(u + 1) = l(q) + u - q;
/* form new elp(x) */
for (int i = 0; i < t2; i++)
elp(u + 1, i) = 0;
for (int i = 0; i <= l(q); i++)
if (elp(q, i) != n)
elp(u + 1, i + u - q) =
tables.alpha_to (modn ((d(u) + n - d(q) + elp(q, i)), m, n));
for (int i = 0; i <= l(u); i++)
{
elp(u + 1, i) ^= elp(u, i);
elp(u, i) = tables.index_of (elp(u, i));
}
}
u_lu(u + 1) = u - l(u + 1);
/* form (u+1)th discrepancy */
if (u < t2)
{
/* no discrepancy computed on last iteration */
d(u + 1) = tables.alpha_to (s(u + 1));
for (int i = 1; i <= l(u + 1); i++)
if ((s(u + 1 - i) != n) && (elp(u + 1, i) != 0))
d(u + 1) ^= tables.alpha_to (modn (s(u + 1 - i)
+ tables.index_of (elp(u + 1, i)),
m, n));
/* put d(u+1) into index form */
d(u + 1) = tables.index_of (d(u + 1));
}
}
while ((u < t2) && (l(u + 1) <= t));
u++;
if (l(u) <= t)
{/* Can correct errors */
int count;
Array loc (dim_vector (t+2, 1));
/* put elp into index form */
for (int i = 0; i <= l(u); i++)
elp(u, i) = tables.index_of (elp(u, i));
/* Chien search: find roots of the error location polynomial */
for (int i = 1; i <= l(u); i++)
reg(i) = elp(u, i);
count = 0;
for (int i = 1; i <= n; i++)
{
q = 1;
for (int j = 1; j <= l(u); j++)
if (reg(j) != n)
{
reg(j) = modn ((reg(j) + j), m, n);
q ^= tables.alpha_to (reg(j));
}
if (!q)
{ /* store root and error
* location number indices */
loc(count) = n - i;
count++;
if (count > l(u))
break;
}
}
if (count == l(u))
{
/* no. roots = degree of elp hence <= t errors */
nerr(lsym) = l(u);
for (int i = 0; i < l(u); i++)
if (parity_at_end)
code(lsym, nn-loc(i)-1) =
(int)code(lsym, nn-loc(i)-1) ^ 1;
else
code(lsym, loc(i)) = (int)code(lsym, loc(i)) ^ 1;
}
else /* elp has degree >t hence cannot solve */
nerr(lsym) = -1;
}
else
nerr(lsym) = -1;
}
}
Matrix msg (nsym, k);
if (parity_at_end)
{
for (int l = 0; l < nsym; l++)
for (int i = 0; i < k; i++)
msg(l, i) = code(l, i);
}
else
{
for (int l = 0; l < nsym; l++)
for (int i = 0; i < k; i++)
msg(l, i) = code(l, nn-k+i);
}
retval(0) = octave_value (msg);
retval(1) = octave_value (nerr);
retval(2) = octave_value (code);
return retval;
}
/*
%% Test input validation
%!error bchdeco ()
%!error bchdeco (1)
%!error bchdeco (1, 2)
%!error bchdeco (1, 2, 3, 4, 5, 6)
*/
communications-1.2.7/src/PaxHeaders/galois-ops.h 0000644 0000000 0000000 00000000062 14746720302 016653 x ustar 00 20 atime=1738252482
30 ctime=1738252593.659705065
communications-1.2.7/src/galois-ops.h 0000644 0001750 0001750 00000013575 14746720302 016010 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#if !defined (galois_octave_ops_h)
#define galois_octave_ops_h 1
#if ! defined (CAST_BINOP_ARGS)
# define CAST_BINOP_ARGS(t1, t2) \
t1 v1 = dynamic_cast (a1); \
t2 v2 = dynamic_cast (a2)
#endif
#if ! defined (CAST_UNOP_ARG)
# define CAST_UNOP_ARG(t) \
t v = dynamic_cast (a)
#endif
#if ! defined (BINOPDECL)
# define BINOPDECL(name, a1, a2) \
static octave_value \
CONCAT2(oct_binop_, name) (const octave_base_value& a1, \
const octave_base_value& a2)
#endif
#if ! defined (CATOPDECL)
# if defined (HAVE_OCTAVE_FIRST_CATOP_ARG_CONST)
# define CATOPDECL(name, a1, a2) \
static octave_value \
CONCAT2(oct_catop_, name) (const octave_base_value& a1, \
const octave_base_value& a2, \
const Array& ra_idx)
# else
# define CATOPDECL(name, a1, a2) \
static octave_value \
CONCAT2(oct_catop_, name) (octave_base_value& a1, \
const octave_base_value& a2, \
const Array& ra_idx)
# endif
#endif
// Override the operator and function definition defines from Octave
#define DEFBINOP_OP_G(name, t1, t2, op) \
BINOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return new octave_galois \
(v1.t1 ## _value () op v2.t2 ## _value ()); \
}
#define DEFBINOP_FN_G(name, t1, t2, f) \
BINOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return new octave_galois (f (v1.t1 ## _value (), v2.t2 ## _value ())); \
}
#define DEFBINOP_OP_B_S1(name, t1, t2, op) \
BINOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return octave_value \
(v1.matrix_value () op v2.t2 ##_value ()); \
}
#define DEFBINOP_FN_B_S1(name, t1, t2, f) \
BINOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return octave_value (f (v1.matrix_value (), v2.t2 ## _value ())); \
}
#define DEFBINOP_OP_G_S1(name, t1, t2, op) \
BINOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return new octave_galois \
(v1.matrix_value () op v2.t2 ## _value ()); \
}
#define DEFBINOP_FN_G_S1(name, t1, t2, f) \
BINOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return new octave_galois (f (v1.matrix_value (), v2.t2 ## _value ())); \
}
#define DEFBINOP_OP_B_S2(name, t1, t2, op) \
BINOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return octave_value \
(v1.t1 ## _value () op v2.matrix_value ()); \
}
#define DEFBINOP_FN_B_S2(name, t1, t2, f) \
BINOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return octave_value (f (v1.t1 ## _value (), v2.matrix_value ())); \
}
#define DEFBINOP_OP_G_S2(name, t1, t2, op) \
BINOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return new octave_galois \
(v1.t1 ## _value () op v2.matrix_value ()); \
}
#define DEFBINOP_FN_G_S2(name, t1, t2, f) \
BINOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return new octave_galois (f (v1.t1 ## _value (), v2.matrix_value ())); \
}
#if defined (HAVE_OCTAVE_FIRST_CATOP_ARG_CONST)
# define DEFCATOP_G_FN(name, t1, t2, f) \
CATOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return new octave_galois (f (v1.t1 ## _value (), v2.t2 ## _value (), \
ra_idx)); \
}
#define DEFCATOP_G_METHOD(name, t1, t2, f) \
CATOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (const octave_ ## t1&, const octave_ ## t2&); \
return new octave_galois (v1.t1 ## _value (). f (v2.t2 ## _value (), \
ra_idx)); \
}
#else
# define DEFCATOP_G_FN(name, t1, t2, f) \
CATOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (octave_ ## t1&, const octave_ ## t2&); \
return new octave_galois (f (v1.t1 ## _value (), v2.t2 ## _value (), \
ra_idx)); \
}
#define DEFCATOP_G_METHOD(name, t1, t2, f) \
CATOPDECL (name, a1, a2) \
{ \
CAST_BINOP_ARGS (octave_ ## t1&, const octave_ ## t2&); \
return new octave_galois (v1.t1 ## _value (). f (v2.t2 ## _value (), \
ra_idx)); \
}
#endif
#define INSTALL_G_CATOP(t1, t2, f) INSTALL_CATOP (t1, t2, f)
#endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/isprimitive.cc 0000644 0000000 0000000 00000000074 14746720302 017303 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/isprimitive.cc 0000644 0001750 0001750 00000007151 14746720302 016426 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
static bool
do_isprimitive (const int& a, const int& m)
{
// Fast return since primitive polynomial can't be even
if (!(a & 1))
return false;
RowVector repr (1< 24)
{
error ("isprimitive: order of the primitive polynomial must "
"be less than 22");
return retval;
}
Matrix b (a.rows (), 1);
for (int i = 0; i < a.rows (); i++)
{
int tmp = (int)a(i, 0);
for (int j = 1; j < a.columns (); j++)
tmp = (tmp << 1) | (int)a(i, j);
int m = 1;
while (tmp > (1<<(m+1)))
m++;
b(i, 0) = do_isprimitive (tmp, m);
}
retval = octave_value (b);
}
else
{
for (int i = 0; i < a.rows (); i++)
for (int j = 0; j < a.columns (); j++)
if (a(i, j) > (1<<23))
{
error ("isprimitive: order of the primitive polynomial must "
"be less than 22");
return retval;
}
Matrix b (a.rows (), a.columns ());
for (int i = 0; i < a.rows (); i++)
{
for (int j = 0; j < a.columns (); j++)
{
int m = 1;
while (a(i, j) > (1<<(m+1)))
m++;
b(i, j) = do_isprimitive ((int)a(i, j), m);
}
}
retval = octave_value (b);
}
return retval;
}
/*
%% Test input validation
%!error isprimitive ()
%!error isprimitive (1, 2)
*/
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/__gfweight__.cc 0000644 0000000 0000000 00000000074 14746720302 017337 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/__gfweight__.cc 0000644 0001750 0001750 00000004765 14746720302 016472 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#include
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
static int
get_weight (const Array& codeword, const Matrix& gen,
int weight, int depth, int start, int n, int k)
{
int retval = weight;
for (int i = start; i < k ; i++)
{
OCTAVE_QUIT;
Array new_codeword (codeword);
int tmp = 0;
for (int j = 0; j < n; j++)
if (new_codeword (j) ^= (char)gen(i,j))
tmp++;
if (tmp < retval)
retval = tmp;
if (depth < retval)
retval = get_weight (new_codeword, gen, retval, depth+1, i+1, n, k);
}
return retval;
}
DEFUN_DLD (__gfweight__, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{w} =} __gfweight__ (@var{gen})\n\
Returns the minimum distance @var{w} of the generator matrix @var{gen}.\n\
The codeword length is @var{k}.\n\
\n\
This is an internal function of @code{gfweight}. You should use\n\
@code{gfweight} rather than use this function directly.\n\
@seealso{gfweight}\n\
@end deftypefn")
{
if (args.length () != 1)
{
print_usage ();
return octave_value ();
}
Matrix gen = args(0).matrix_value ();
int k = gen.rows ();
int n = gen.columns ();
if (k > 128)
{
octave_stdout << "__gfweight__: this is likely to take a very long time!!\n";
OCTAVE__FLUSH_STDOUT ();
}
Array codeword (dim_vector (n, 1), 0);
return octave_value ((double)get_weight (codeword, gen, n - k + 1, 1,
0, n, k));
}
/*
%% Test input validation
%!error __gfweight__ ()
%!error __gfweight__ (1, 2)
*/
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/op-gm-gm.cc 0000644 0000000 0000000 00000000074 14746720302 016357 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/op-gm-gm.cc 0000644 0001750 0001750 00000013651 14746720302 015504 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
#ifdef HAVE_OCTAVE_OVL_H
#include
#elif HAVE_OCTAVE_OCT_OBJ_H
#include
#endif
#include
#include "galois.h"
#include "ov-galois.h"
#include "galois-ops.h"
// galois unary ops.
DEFUNOP_OP (not, galois, !)
DEFUNOP (uminus, galois)
{
CAST_UNOP_ARG (const octave_galois&);
// Unitary minus of Galois Field is itself!!
return new octave_galois (v.galois_value ());
}
DEFUNOP (uplus, galois)
{
CAST_UNOP_ARG (const octave_galois&);
return new octave_galois (v.galois_value ());
}
DEFUNOP (transpose, galois)
{
CAST_UNOP_ARG (const octave_galois&);
return new octave_galois (v.galois_value ().transpose ());
}
// galois by galois ops.
DEFBINOP_OP_G (add, galois, galois, +)
DEFBINOP_OP_G (sub, galois, galois, -)
DEFBINOP_OP_G (mul, galois, galois, *)
DEFBINOP_FN_G (div, galois, galois, xdiv)
DEFBINOP_FN_G (pow, galois, galois, pow)
DEFBINOP_FN_G (ldiv, galois, galois, xleftdiv)
DEFBINOP_FN (lt, galois, galois, mx_el_lt)
DEFBINOP_FN (le, galois, galois, mx_el_le)
DEFBINOP_FN (eq, galois, galois, mx_el_eq)
DEFBINOP_FN (ge, galois, galois, mx_el_ge)
DEFBINOP_FN (gt, galois, galois, mx_el_gt)
DEFBINOP_FN (ne, galois, galois, mx_el_ne)
DEFBINOP_FN_G (el_mul, galois, galois, product)
DEFBINOP_FN_G (el_div, galois, galois, quotient)
DEFBINOP_FN_G (el_pow, galois, galois, elem_pow)
DEFBINOP (el_ldiv, galois, galois)
{
CAST_BINOP_ARGS (const octave_galois&, const octave_galois&);
return new octave_galois (quotient (v2.galois_value (), v1.galois_value ()));
}
DEFBINOP_FN (el_and, galois, galois, mx_el_and)
DEFBINOP_FN (el_or, galois, galois, mx_el_or)
DEFCATOP_G_METHOD (gm_gm, galois, galois, concat)
DEFASSIGNOP_FN (assign, galois, galois, assign)
#ifndef DEFMETHOD_DLD
void
install_gm_gm_ops (void)
{
INSTALL_UNOP (op_not, octave_galois, not);
INSTALL_UNOP (op_uminus, octave_galois, uminus);
INSTALL_UNOP (op_uplus, octave_galois, uplus);
INSTALL_UNOP (op_transpose, octave_galois, transpose);
INSTALL_UNOP (op_hermitian, octave_galois, transpose);
INSTALL_BINOP (op_add, octave_galois, octave_galois, add);
INSTALL_BINOP (op_sub, octave_galois, octave_galois, sub);
INSTALL_BINOP (op_mul, octave_galois, octave_galois, mul);
INSTALL_BINOP (op_div, octave_galois, octave_galois, div);
INSTALL_BINOP (op_pow, octave_galois, octave_galois, pow);
INSTALL_BINOP (op_ldiv, octave_galois, octave_galois, ldiv);
INSTALL_BINOP (op_lt, octave_galois, octave_galois, lt);
INSTALL_BINOP (op_le, octave_galois, octave_galois, le);
INSTALL_BINOP (op_eq, octave_galois, octave_galois, eq);
INSTALL_BINOP (op_ge, octave_galois, octave_galois, ge);
INSTALL_BINOP (op_gt, octave_galois, octave_galois, gt);
INSTALL_BINOP (op_ne, octave_galois, octave_galois, ne);
INSTALL_BINOP (op_el_mul, octave_galois, octave_galois, el_mul);
INSTALL_BINOP (op_el_div, octave_galois, octave_galois, el_div);
INSTALL_BINOP (op_el_pow, octave_galois, octave_galois, el_pow);
INSTALL_BINOP (op_el_ldiv, octave_galois, octave_galois, el_ldiv);
INSTALL_BINOP (op_el_and, octave_galois, octave_galois, el_and);
INSTALL_BINOP (op_el_or, octave_galois, octave_galois, el_or);
INSTALL_G_CATOP (octave_galois, octave_galois, gm_gm);
INSTALL_ASSIGNOP (op_asn_eq, octave_galois, octave_galois, assign);
}
#else
void
install_gm_gm_ops (octave::type_info& ti)
{
INSTALL_UNOP_TI (ti, op_not, octave_galois, not);
INSTALL_UNOP_TI (ti, op_uminus, octave_galois, uminus);
INSTALL_UNOP_TI (ti, op_uplus, octave_galois, uplus);
INSTALL_UNOP_TI (ti, op_transpose, octave_galois, transpose);
INSTALL_UNOP_TI (ti, op_hermitian, octave_galois, transpose);
INSTALL_BINOP_TI (ti, op_add, octave_galois, octave_galois, add);
INSTALL_BINOP_TI (ti, op_sub, octave_galois, octave_galois, sub);
INSTALL_BINOP_TI (ti, op_mul, octave_galois, octave_galois, mul);
INSTALL_BINOP_TI (ti, op_div, octave_galois, octave_galois, div);
INSTALL_BINOP_TI (ti, op_pow, octave_galois, octave_galois, pow);
INSTALL_BINOP_TI (ti, op_ldiv, octave_galois, octave_galois, ldiv);
INSTALL_BINOP_TI (ti, op_lt, octave_galois, octave_galois, lt);
INSTALL_BINOP_TI (ti, op_le, octave_galois, octave_galois, le);
INSTALL_BINOP_TI (ti, op_eq, octave_galois, octave_galois, eq);
INSTALL_BINOP_TI (ti, op_ge, octave_galois, octave_galois, ge);
INSTALL_BINOP_TI (ti, op_gt, octave_galois, octave_galois, gt);
INSTALL_BINOP_TI (ti, op_ne, octave_galois, octave_galois, ne);
INSTALL_BINOP_TI (ti, op_el_mul, octave_galois, octave_galois, el_mul);
INSTALL_BINOP_TI (ti, op_el_div, octave_galois, octave_galois, el_div);
INSTALL_BINOP_TI (ti, op_el_pow, octave_galois, octave_galois, el_pow);
INSTALL_BINOP_TI (ti, op_el_ldiv, octave_galois, octave_galois, el_ldiv);
INSTALL_BINOP_TI (ti, op_el_and, octave_galois, octave_galois, el_and);
INSTALL_BINOP_TI (ti, op_el_or, octave_galois, octave_galois, el_or);
INSTALL_CATOP_TI (ti, octave_galois, octave_galois, gm_gm);
INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_galois, octave_galois, assign);
}
#endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/op-s-gm.cc 0000644 0000000 0000000 00000000074 14746720302 016216 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/op-s-gm.cc 0000644 0001750 0001750 00000013162 14746720302 015340 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
#include
#include
#include "galois.h"
#include "ov-galois.h"
#include "galois-ops.h"
// scalar by galois ops.
DEFBINOP_OP_G_S1 (add, scalar, galois, +)
DEFBINOP_OP_G_S1 (sub, scalar, galois, -)
DEFBINOP_FN_G_S1 (mul, scalar, galois, product)
DEFBINOP_FN_G_S1 (div, scalar, galois, xdiv)
DEFBINOP (pow, scalar, galois)
{
CAST_BINOP_ARGS (const octave_scalar&, const octave_galois&);
galois tmp (v1.matrix_value (), v2.m (), v2.primpoly ());
return new octave_galois (pow (tmp, v2.galois_value ()));
}
DEFBINOP (ldiv, scalar, galois)
{
CAST_BINOP_ARGS (const octave_scalar&, const octave_galois&); \
return new octave_galois (quotient (v2.galois_value (), v1.matrix_value ()));
}
DEFBINOP_FN_B_S1 (lt, scalar, galois, mx_el_lt)
DEFBINOP_FN_B_S1 (le, scalar, galois, mx_el_le)
DEFBINOP_FN_B_S1 (eq, scalar, galois, mx_el_eq)
DEFBINOP_FN_B_S1 (ge, scalar, galois, mx_el_ge)
DEFBINOP_FN_B_S1 (gt, scalar, galois, mx_el_gt)
DEFBINOP_FN_B_S1 (ne, scalar, galois, mx_el_ne)
DEFBINOP_FN_G_S1 (el_mul, scalar, galois, product)
DEFBINOP_FN_G_S1 (el_div, scalar, galois, quotient)
DEFBINOP (el_pow, scalar, galois)
{
CAST_BINOP_ARGS (const octave_scalar&, const octave_galois&); \
galois tmp (v1.matrix_value (), v2.m (), v2.primpoly ());
return new octave_galois (elem_pow (tmp, v2.galois_value ()));
}
DEFBINOP (el_ldiv, scalar, galois)
{
CAST_BINOP_ARGS (const octave_scalar&, const octave_galois&);
return new octave_galois (quotient (v2.galois_value (), v1.matrix_value ()));
}
DEFBINOP_FN_B_S1 (el_and, scalar, galois, mx_el_and)
DEFBINOP_FN_B_S1 (el_or, scalar, galois, mx_el_or)
DEFCATOP (s_gm, scalar, galois)
{
#if defined (HAVE_OCTAVE_FIRST_CATOP_ARG_CONST)
CAST_BINOP_ARGS (const octave_scalar&, const octave_galois&);
#else
CAST_BINOP_ARGS (octave_scalar&, const octave_galois&);
#endif
return new octave_galois (concat (v1.matrix_value (), v2.galois_value (),
ra_idx));
}
#ifndef DEFMETHOD_DLD
void
install_s_gm_ops (void)
{
INSTALL_BINOP (op_add, octave_scalar, octave_galois, add);
INSTALL_BINOP (op_sub, octave_scalar, octave_galois, sub);
INSTALL_BINOP (op_mul, octave_scalar, octave_galois, mul);
INSTALL_BINOP (op_div, octave_scalar, octave_galois, div);
INSTALL_BINOP (op_pow, octave_scalar, octave_galois, pow);
INSTALL_BINOP (op_ldiv, octave_scalar, octave_galois, ldiv);
INSTALL_BINOP (op_lt, octave_scalar, octave_galois, lt);
INSTALL_BINOP (op_le, octave_scalar, octave_galois, le);
INSTALL_BINOP (op_eq, octave_scalar, octave_galois, eq);
INSTALL_BINOP (op_ge, octave_scalar, octave_galois, ge);
INSTALL_BINOP (op_gt, octave_scalar, octave_galois, gt);
INSTALL_BINOP (op_ne, octave_scalar, octave_galois, ne);
INSTALL_BINOP (op_el_mul, octave_scalar, octave_galois, el_mul);
INSTALL_BINOP (op_el_div, octave_scalar, octave_galois, el_div);
INSTALL_BINOP (op_el_pow, octave_scalar, octave_galois, el_pow);
INSTALL_BINOP (op_el_ldiv, octave_scalar, octave_galois, el_ldiv);
INSTALL_BINOP (op_el_and, octave_scalar, octave_galois, el_and);
INSTALL_BINOP (op_el_or, octave_scalar, octave_galois, el_or);
INSTALL_G_CATOP (octave_scalar, octave_galois, s_gm);
INSTALL_ASSIGNCONV (octave_scalar, octave_galois, octave_galois);
}
#else
void
install_s_gm_ops (octave::type_info& ti)
{
INSTALL_BINOP_TI (ti, op_add, octave_scalar, octave_galois, add);
INSTALL_BINOP_TI (ti, op_sub, octave_scalar, octave_galois, sub);
INSTALL_BINOP_TI (ti, op_mul, octave_scalar, octave_galois, mul);
INSTALL_BINOP_TI (ti, op_div, octave_scalar, octave_galois, div);
INSTALL_BINOP_TI (ti, op_pow, octave_scalar, octave_galois, pow);
INSTALL_BINOP_TI (ti, op_ldiv, octave_scalar, octave_galois, ldiv);
INSTALL_BINOP_TI (ti, op_lt, octave_scalar, octave_galois, lt);
INSTALL_BINOP_TI (ti, op_le, octave_scalar, octave_galois, le);
INSTALL_BINOP_TI (ti, op_eq, octave_scalar, octave_galois, eq);
INSTALL_BINOP_TI (ti, op_ge, octave_scalar, octave_galois, ge);
INSTALL_BINOP_TI (ti, op_gt, octave_scalar, octave_galois, gt);
INSTALL_BINOP_TI (ti, op_ne, octave_scalar, octave_galois, ne);
INSTALL_BINOP_TI (ti, op_el_mul, octave_scalar, octave_galois, el_mul);
INSTALL_BINOP_TI (ti, op_el_div, octave_scalar, octave_galois, el_div);
INSTALL_BINOP_TI (ti, op_el_pow, octave_scalar, octave_galois, el_pow);
INSTALL_BINOP_TI (ti, op_el_ldiv, octave_scalar, octave_galois, el_ldiv);
INSTALL_BINOP_TI (ti, op_el_and, octave_scalar, octave_galois, el_and);
INSTALL_BINOP_TI (ti, op_el_or, octave_scalar, octave_galois, el_or);
INSTALL_CATOP_TI (ti, octave_scalar, octave_galois, s_gm);
INSTALL_ASSIGNCONV_TI (ti, octave_scalar, octave_galois, octave_galois);
}
#endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/bootstrap 0000644 0000000 0000000 00000000074 14746720302 016370 x ustar 00 30 atime=1738252593.071700638
30 ctime=1738252593.659705065
communications-1.2.7/src/bootstrap 0000755 0001750 0001750 00000000337 14746720302 015515 0 ustar 00nir nir #!/bin/bash
## Octave-Forge: package bootstrap script
## Run this to generate the configure script
set -e # halt if unhandled error
aclocal
autoconf # generate configure script
autoheader -f
rm -rf autom4te.cache
communications-1.2.7/src/PaxHeaders/m4 0000644 0000000 0000000 00000000132 14746720432 014672 x ustar 00 30 mtime=1738252570.143527988
30 atime=1738252593.659705065
30 ctime=1738252593.659705065
communications-1.2.7/src/m4/ 0000755 0001750 0001750 00000000000 14746720432 014073 5 ustar 00nir nir communications-1.2.7/src/m4/PaxHeaders/octave-forge.m4 0000644 0000000 0000000 00000000074 14746720302 017573 x ustar 00 30 atime=1738252593.222701775
30 ctime=1738252593.659705065
communications-1.2.7/src/m4/octave-forge.m4 0000644 0001750 0001750 00000005760 14746720302 016722 0 ustar 00nir nir # Copyright (C) 2017-2018 Olaf Till
# Modifications to print what is searching for by JohnD
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
# arguments of OF_OCTAVE_ALT_SYMS (see also description of
# OF_OCTAVE_LIST_ALT_SYMS below):
#
# $1: symbol version 1
# $2: symbol version 2
# $3: test for symbol version 2
# $4: macro name to access alternative symbols
# $5: include directives for symbol version 1
# $6: include directives for symbol version 2
# (a list of lists of args 1--6 is $1 of OF_OCTAVE_LIST_ALT_SYMS)
# $7: name of generated include file with alternatives of Octave headers
# (arg7 is $2 of OF_OCTAVE_LIST_ALT_SYMS)
AC_DEFUN([OF_OCTAVE_ALT_SYMS], [
AC_MSG_CHECKING([$1 or $2])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include ]
$6],
[$3])],
[AC_DEFINE($4,
[[$2]],
[macro for alternative Octave symbols])
AC_MSG_RESULT([$2])
echo '$6' >> $7],
[AC_DEFINE($4,
[[$1]],
[macro for alternative Octave symbols])
AC_MSG_RESULT([$1])
echo '$5' >> $7]
)
])
# OF_OCTAVE_LIST_ALT_SYMS is called in the following way:
#
# OF_OCTAVE_LIST_ALT_SYMS([
# [dnl
# [old_octave_symbol],
# [new_octave_symbol],
# [[compilation test]
# [for new_octave_symbol]],
# [NAME_OF_GENERATED_MACRO____WILL_EXPAND_TO_OLD_OR_NEW_SYMBOL],
# [[include directives]
# [except #include ]
# [necessary to compile with old_octave_symbol]],
# [[include directives]
# [except #include ]
# [nessary to compile with new_octave_symbol]
# [and to compile the test]]
# ],
#
# ... further such lists as the above
#
# ],
#
# [name-of-header-file-for-alternative-octave-iclude-directives.h])
#
#
# This file should be put into src/m4/, and the line
#
# AC_CONFIG_MACRO_DIRS([m4])
#
# should be put into src/configure.ac. The package should use
# autoheader to generate config.h.in (src/bootstrap should contain the
# lines 'aclocal', 'autoconf', and 'autoheader -f'). Package code
# should include config.h and use the generated macros to access the
# alternative symbols of Octave. An example of a call to
# OF_OCTAVE_LIST_ALT_SYMS in src/configure.ac is available together
# with this file.
AC_DEFUN([OF_OCTAVE_LIST_ALT_SYMS], [
echo '/* generated by configure */' > $2
m4_foreach([it], [$1], [m4_apply([OF_OCTAVE_ALT_SYMS], [it, $2])])
AH_BOTTOM([#include "$2"])
])
communications-1.2.7/src/PaxHeaders/config.h.in 0000644 0000000 0000000 00000000132 14746720461 016454 x ustar 00 30 mtime=1738252593.656705141
30 atime=1738252593.656705141
30 ctime=1738252593.659705065
communications-1.2.7/src/config.h.in 0000644 0001750 0001750 00000007301 14746720461 015601 0 ustar 00nir nir /* config.h.in. Generated from configure.ac by autoheader. */
#include "undef-ah-octave.h"
/* macro for alternative Octave symbols */
#undef DELOCTAVE__ERR_SQUARE_MATRIX_REQUIRED
/* Define to 1 if you have the header file. */
#undef HAVE_HDF5_H
/* Define to 1 if you have the header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the header file. */
#undef HAVE_OCTAVE_BASE_LU_H
/* Define if have gripe_load and gripe_save */
#undef HAVE_OCTAVE_BASE_VALUE_GRIPE_LOAD_SAVE
/* Define if octave_base_value::print is const-qualified */
#undef HAVE_OCTAVE_BASE_VALUE_PRINT_CONST
/* Define to 1 if you have the header file. */
#undef HAVE_OCTAVE_ERRWARN_H
/* Define if first catop function argument is const-qualified */
#undef HAVE_OCTAVE_FIRST_CATOP_ARG_CONST
/* Define to 1 if you have the header file. */
#undef HAVE_OCTAVE_GRIPES_H
/* Define if have octave_hdf5_id */
#undef HAVE_OCTAVE_HDF5_ID_TYPE
/* Define to 1 if you have the header file. */
#undef HAVE_OCTAVE_INTERPRETER_H
/* Define to 1 if you have the header file. */
#undef HAVE_OCTAVE_LS_OCT_ASCII_H
/* Define to 1 if you have the header file. */
#undef HAVE_OCTAVE_LS_OCT_TEXT_H
/* Define to 1 if you have the header file. */
#undef HAVE_OCTAVE_LU_H
/* Define to 1 if you have the header file. */
#undef HAVE_OCTAVE_OCT_H
/* Define to 1 if you have the header file. */
#undef HAVE_OCTAVE_OCT_OBJ_H
/* Define to 1 if you have the header file. */
#undef HAVE_OCTAVE_OVL_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDIO_H
/* Define to 1 if you have the header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the header file. */
#undef HAVE_UNISTD_H
/* macro for alternative Octave symbols */
#undef OCTAVE_MACH_INFO_FLOAT_FORMAT
/* macro for alternative Octave symbols */
#undef OCTAVE__ERR_INVALID_CONVERSION
/* macro for alternative Octave symbols */
#undef OCTAVE__ERR_NONCONFORMANT
/* macro for alternative Octave symbols */
#undef OCTAVE__ERR_WRONG_TYPE_ARG
/* macro for alternative Octave symbols */
#undef OCTAVE__FLUSH_STDOUT
/* macro for alternative Octave symbols */
#undef OCTAVE__WARN_INVALID_CONVERSION
/* macro for alternative Octave symbols */
#undef OV_ISCOMPLEX
/* macro for alternative Octave symbols */
#undef OV_ISEMPTY
/* macro for alternative Octave symbols */
#undef OV_ISNUMERIC
/* macro for alternative Octave symbols */
#undef OV_ISREAL
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if all of the C90 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
#include "oct-alt-includes.h"
communications-1.2.7/src/PaxHeaders/op-gm-m.cc 0000644 0000000 0000000 00000000074 14746720302 016210 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/op-gm-m.cc 0000644 0001750 0001750 00000012520 14746720302 015327 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
#include
#include
#include "galois.h"
#include "ov-galois.h"
#include "galois-ops.h"
// galois by matrix ops.
DEFBINOP_OP_G (add, galois, matrix, +)
DEFBINOP_OP_G (sub, galois, matrix, -)
DEFBINOP_OP_G (mul, galois, matrix, *)
DEFBINOP_FN_G (div, galois, matrix, xdiv)
DEFBINOPX (pow, galois, matrix)
{
error ("for A^x, A must be square and x scalar");
return octave_value ();
}
DEFBINOP_FN_G (ldiv, galois, matrix, xleftdiv)
DEFBINOP_FN (lt, galois, matrix, mx_el_lt)
DEFBINOP_FN (le, galois, matrix, mx_el_le)
DEFBINOP_FN (eq, galois, matrix, mx_el_eq)
DEFBINOP_FN (ge, galois, matrix, mx_el_ge)
DEFBINOP_FN (gt, galois, matrix, mx_el_gt)
DEFBINOP_FN (ne, galois, matrix, mx_el_ne)
DEFBINOP_FN_G (el_mul, galois, matrix, product)
DEFBINOP_FN_G (el_div, galois, matrix, quotient)
DEFBINOP_FN_G (el_pow, galois, matrix, elem_pow)
DEFBINOP (el_ldiv, galois, matrix)
{
CAST_BINOP_ARGS (const octave_galois&, const octave_matrix&);
return new octave_galois (quotient (v2.matrix_value (), v1.galois_value ()));
}
DEFBINOP_FN (el_and, galois, matrix, mx_el_and)
DEFBINOP_FN (el_or, galois, matrix, mx_el_or)
DEFCATOP_G_METHOD (gm_m, galois, matrix, concat)
// Need to create temporary Galois array so that matrix values are checked
DEFASSIGNOP (assign, galois, matrix)
{
CAST_BINOP_ARGS (octave_galois&, const octave_matrix&);
v1.assign (idx, galois (v2.matrix_value (), v1.galois_value ().m (),
v1.galois_value ().primpoly ()));
return octave_value ();
}
#ifndef DEFMETHOD_DLD
void
install_gm_m_ops (void)
{
INSTALL_BINOP (op_add, octave_galois, octave_matrix, add);
INSTALL_BINOP (op_sub, octave_galois, octave_matrix, sub);
INSTALL_BINOP (op_mul, octave_galois, octave_matrix, mul);
INSTALL_BINOP (op_div, octave_galois, octave_matrix, div);
INSTALL_BINOP (op_pow, octave_galois, octave_matrix, pow);
INSTALL_BINOP (op_ldiv, octave_galois, octave_matrix, ldiv);
INSTALL_BINOP (op_lt, octave_galois, octave_matrix, lt);
INSTALL_BINOP (op_le, octave_galois, octave_matrix, le);
INSTALL_BINOP (op_eq, octave_galois, octave_matrix, eq);
INSTALL_BINOP (op_ge, octave_galois, octave_matrix, ge);
INSTALL_BINOP (op_gt, octave_galois, octave_matrix, gt);
INSTALL_BINOP (op_ne, octave_galois, octave_matrix, ne);
INSTALL_BINOP (op_el_mul, octave_galois, octave_matrix, el_mul);
INSTALL_BINOP (op_el_div, octave_galois, octave_matrix, el_div);
INSTALL_BINOP (op_el_pow, octave_galois, octave_matrix, el_pow);
INSTALL_BINOP (op_el_ldiv, octave_galois, octave_matrix, el_ldiv);
INSTALL_BINOP (op_el_and, octave_galois, octave_matrix, el_and);
INSTALL_BINOP (op_el_or, octave_galois, octave_matrix, el_or);
INSTALL_G_CATOP (octave_galois, octave_matrix, gm_m);
INSTALL_ASSIGNOP (op_asn_eq, octave_galois, octave_matrix, assign);
INSTALL_ASSIGNCONV (octave_base_value, octave_galois, octave_matrix);
}
#else
void
install_gm_m_ops (octave::type_info& ti)
{
INSTALL_BINOP_TI (ti, op_add, octave_galois, octave_matrix, add);
INSTALL_BINOP_TI (ti, op_sub, octave_galois, octave_matrix, sub);
INSTALL_BINOP_TI (ti, op_mul, octave_galois, octave_matrix, mul);
INSTALL_BINOP_TI (ti, op_div, octave_galois, octave_matrix, div);
INSTALL_BINOP_TI (ti, op_pow, octave_galois, octave_matrix, pow);
INSTALL_BINOP_TI (ti, op_ldiv, octave_galois, octave_matrix, ldiv);
INSTALL_BINOP_TI (ti, op_lt, octave_galois, octave_matrix, lt);
INSTALL_BINOP_TI (ti, op_le, octave_galois, octave_matrix, le);
INSTALL_BINOP_TI (ti, op_eq, octave_galois, octave_matrix, eq);
INSTALL_BINOP_TI (ti, op_ge, octave_galois, octave_matrix, ge);
INSTALL_BINOP_TI (ti, op_gt, octave_galois, octave_matrix, gt);
INSTALL_BINOP_TI (ti, op_ne, octave_galois, octave_matrix, ne);
INSTALL_BINOP_TI (ti, op_el_mul, octave_galois, octave_matrix, el_mul);
INSTALL_BINOP_TI (ti, op_el_div, octave_galois, octave_matrix, el_div);
INSTALL_BINOP_TI (ti, op_el_pow, octave_galois, octave_matrix, el_pow);
INSTALL_BINOP_TI (ti, op_el_ldiv, octave_galois, octave_matrix, el_ldiv);
INSTALL_BINOP_TI (ti, op_el_and, octave_galois, octave_matrix, el_and);
INSTALL_BINOP_TI (ti, op_el_or, octave_galois, octave_matrix, el_or);
INSTALL_CATOP_TI (ti, octave_galois, octave_matrix, gm_m);
INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_galois, octave_matrix, assign);
INSTALL_ASSIGNCONV_TI (ti, octave_base_value, octave_galois, octave_matrix);
}
#endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/genqamdemod.cc 0000644 0000000 0000000 00000000074 14746720302 017220 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/genqamdemod.cc 0000644 0001750 0001750 00000006350 14746720302 016343 0 ustar 00nir nir //Copyright (C) 2006 Charalampos C. Tsimenidis
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
#include
DEFUN_DLD (genqamdemod, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{y} =} genqamdemod (@var{x}, @var{C})\n\
General quadrature amplitude demodulation. The complex envelope\n\
quadrature amplitude modulated signal @var{x} is demodulated using a\n\
constellation mapping specified by the 1D vector @var{C}.\n\
@end deftypefn")
{
octave_value retval;
int i, j, m;
double tmp1, tmp2;
if (args.length () != 2)
{
print_usage ();
return retval;
}
int nr1 (args(0).rows ());
int nc1 (args(0).columns ());
int arg_is_empty1 = args(0).OV_ISEMPTY();
Matrix y (nr1,nc1);
int nr2 (args(1).rows ());
int nc2 (args(1).columns ());
int M = (nr2>nc2)?nr2:nc2;
if (arg_is_empty1 < 0)
return retval;
if (arg_is_empty1 > 0)
return octave_value (Matrix ());
if (args(0).OV_ISREAL () && args(1).OV_ISREAL ())
{ // Real-valued signal & constellation
Matrix x (args(0).matrix_value ());
ColumnVector constellation (args(1).vector_value ());
for (i = 0;i < nr1;i++)
{
for (j = 0;j < nc1;j++)
{
tmp1 = fabs (x(i,j)-constellation(0));
y(i,j) = 0;
for (m = 1; m < M;m++)
{
tmp2 = fabs (x(i,j)-constellation(m));
if (tmp2 < tmp1)
{
y(i,j) = m;
tmp1 = tmp2;
}
}
}
}
}
else if (args(0).OV_ISCOMPLEX () || args(1).OV_ISCOMPLEX ())
{ // Complex-valued input & constellation
ComplexMatrix x (args(0).complex_matrix_value ());
ComplexColumnVector constellation (args(1).complex_vector_value ());
for (i = 0;i < nr1;i++)
{
for (j = 0;j < nc1;j++)
{
tmp1 = abs (x(i,j)-constellation(0));
y(i,j) = 0;
for (m = 1;m < M;m++)
{
tmp2 = abs (x(i,j)-constellation(m));
if (tmp2 < tmp1)
{
y(i,j) = m;
tmp1 = tmp2;
}
}
}
}
}
else
{
print_usage ();
}
return retval = y;
}
/*
%!assert (genqamdemod ([-7:2:7], [-7:2:7]), [0:7])
%!assert (genqamdemod ([-7 -5 -1 -3 7 5 1 3], [-7 -5 -1 -3 7 5 1 3]), [0:7])
%% Test input validation
%!error genqamdemod ()
%!error genqamdemod (1)
%!error genqamdemod (1, 2, 3)
*/
communications-1.2.7/src/PaxHeaders/cyclgen.cc 0000644 0000000 0000000 00000000074 14746720302 016363 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/cyclgen.cc 0000644 0001750 0001750 00000016574 14746720302 015517 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#include
#include
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
// A simplified version of the filter function for specific lengths of a and b
// in the Galois field GF(2)
Array
filter_gf2 (const Array& b, const Array& a,
const Array& x, const int& n)
{
int x_len = x.numel ();
Array si (dim_vector (n, 1), 0);
Array y (dim_vector (x_len, 1), 0);
for (int i = 0; i < x_len; i++)
{
y(i) = si(0);
if (b(0) && x(i))
y(i) ^= 1;
for (int j = 0; j < n - 1; j++)
{
si(j) = si(j+1);
if (a(j+1) && y(i))
si(j) ^= 1;
if (b(j+1) && x(i))
si(j) ^= 1;
}
si(n-1) = 0;
if (a(n) && y(i))
si(n-1) ^= 1;
if (b(n) && x(i))
si(n-1) ^= 1;
}
return y;
}
// Cyclic polynomial is irreducible. I.E. it divides into x^n-1
// without remainder There must surely be an easier way of doing this
// as the polynomials are over GF(2).
static bool
do_is_cyclic_polynomial (const Array& a, const int& n, const int& m)
{
Array y (dim_vector (n+1, 1), 0);
Array x (dim_vector (n-m+2, 1), 0);
y(0) = 1;
y(n) = 1;
x(0) = 1;
Array b = filter_gf2 (y, a, x, n);
b.resize (dim_vector (n+1, 1), 0);
Array p (dim_vector (m+1, 1), 0);
p(0) = 1;
Array q = filter_gf2 (a, p, b, m);
for (int i = 0; i < n+1; i++)
if (y(i) ^ q(i))
return false;
return true;
}
DEFUN_DLD (cyclgen, args, nargout,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{h} =} cyclgen (@var{n}, @var{p})\n\
@deftypefnx {Loadable Function} {@var{h} =} cyclgen (@var{n}, @var{p}, @var{typ})\n\
@deftypefnx {Loadable Function} {[@var{h}, @var{g}] =} cyclgen (@dots{})\n\
@deftypefnx {Loadable Function} {[@var{h}, @var{g}, @var{k}] =} cyclgen (@dots{})\n\
Produce the parity check and generator matrix of a cyclic code. The parity\n\
check matrix is returned as a @var{m} by @var{n} matrix, representing the\n\
[@var{n},@var{k}] cyclic code. @var{m} is the order of the generator\n\
polynomial @var{p} and the message length @var{k} is given by\n\
@code{@var{n} - @var{m}}.\n\
\n\
The generator polynomial can either be a vector of ones and zeros,\n\
and length @var{m} representing,\n\
@tex\n\
$$ p_0 + p_1 x + p_2 x^2 + \\cdots + p_m x^{m-1} $$\n\
@end tex\n\
@ifnottex\n\
\n\
@example\n\
@var{p}(1) + @var{p}(2) * x + @var{p}(3) * x^2 + ... + @var{p}(@var{m}) * x^(m-1)\n\
@end example\n\
@end ifnottex\n\
\n\
The terms of the polynomial are stored least-significant term first.\n\
Alternatively, @var{p} can be an integer representation of the same\n\
polynomial.\n\
\n\
The form of the parity check matrix is determined by @var{typ}. If\n\
@var{typ} is 'system', a systematic parity check matrix is produced. If\n\
@var{typ} is 'nosys' and non-systematic parity check matrix is produced.\n\
\n\
If requested @code{cyclgen} also returns the @var{k} by @var{n} generator\n\
matrix @var{g}.\
\n\
@seealso{hammgen, gen2par, cyclpoly}\n\
@end deftypefn")
{
octave_value_list retval;
int nargin = args.length ();
unsigned long long p = 0;
int n, m, k, mm;
bool system = true;
Array pp;
if (nargin < 2 || nargin > 3)
{
print_usage ();
return retval;
}
n = args(0).int_value ();
m = 1;
while (n > (1<<(m+1)))
m++;
pp.resize (dim_vector (n+1, 1), 0);
if (args(1).is_scalar_type ())
{
p = (unsigned long long)(args(1).int_value ());
mm = 1;
while (p > ((unsigned long long)1<<(mm+1)))
mm++;
for (int i = 0; i < mm+1; i++)
pp(i) = (p & (1< 2)
{
if (args(2).is_string ())
{
std::string s_arg = args(2).string_value ();
if (s_arg == "system")
system = true;
else if (s_arg == "nosys")
system = false;
else
{
error ("cyclgen: illegal argument");
return retval;
}
}
else
{
error ("cyclgen: illegal argument");
return retval;
}
}
// Haven't implemented this since I'm not sure what matlab wants here
if (!system)
{
error ("cyclgen: non-systematic generator matrices not implemented");
return retval;
}
if (!do_is_cyclic_polynomial (pp, n, mm))
{
error ("cyclgen: generator polynomial does not produce cyclic code");
return retval;
}
unsigned long long mask = 1;
unsigned long long *alpha_to =
(unsigned long long *)malloc (sizeof (unsigned long long) * n);
for (int i = 0; i < n; i++)
{
alpha_to[i] = mask;
mask <<= 1;
if (mask & ((unsigned long long)1< 1)
{
Matrix generator (k, n, 0);
for (int i = 0; i < (int)k; i++)
for (int j = 0; j < (int)mm; j++)
generator(i, j) = parity(j, i+mm);
for (int i = 0; i < (int)k; i++)
generator(i, i+mm) = 1;
retval(1) = octave_value (generator);
retval(2) = octave_value ((double)k);
}
return retval;
}
/*
%% Test input validation
%!error cyclgen ()
%!error cyclgen (1)
%!error cyclgen (1, 2, 3, 4)
*/
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/configure 0000644 0000000 0000000 00000000132 14746720461 016335 x ustar 00 30 mtime=1738252593.502703883
30 atime=1738252593.473703665
30 ctime=1738252593.659705065
communications-1.2.7/src/configure 0000755 0001750 0001750 00000550471 14746720461 015500 0 ustar 00nir nir #! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for Octave-Forge communications package 0.
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
# Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
as_nop=:
if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
# Reset variables that may have inherited troublesome values from
# the environment.
# IFS needs to be set, to space, tab, and newline, in precisely that order.
# (If _AS_PATH_WALK were called with IFS unset, it would have the
# side effect of setting IFS to empty, thus disabling word splitting.)
# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
IFS=" "" $as_nl"
PS1='$ '
PS2='> '
PS4='+ '
# Ensure predictable behavior from utilities with locale-dependent output.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# We cannot yet rely on "unset" to work, but we need these variables
# to be unset--not just set to an empty or harmless value--now, to
# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
# also avoids known problems related to "unset" and subshell syntax
# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
do eval test \${$as_var+y} \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
# Ensure that fds 0, 1, and 2 are open.
if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="as_nop=:
if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else \$as_nop
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
"
as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" )
then :
else \$as_nop
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
blah=\$(echo \$(echo blah))
test x\"\$blah\" = xblah || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
if (eval "$as_required") 2>/dev/null
then :
as_have_required=yes
else $as_nop
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
then :
else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
then :
CONFIG_SHELL=$as_shell as_have_required=yes
if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
then :
break 2
fi
fi
done;;
esac
as_found=false
done
IFS=$as_save_IFS
if $as_found
then :
else $as_nop
if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi
fi
if test "x$CONFIG_SHELL" != x
then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
if test x$as_have_required = xno
then :
printf "%s\n" "$0: This script requires a shell more modern than all"
printf "%s\n" "$0: the shells that I found on your system."
if test ${ZSH_VERSION+y} ; then
printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
else
printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_nop
# ---------
# Do nothing but, unlike ":", preserve the value of $?.
as_fn_nop ()
{
return $?
}
as_nop=as_fn_nop
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_nop
# ---------
# Do nothing but, unlike ":", preserve the value of $?.
as_fn_nop ()
{
return $?
}
as_nop=as_fn_nop
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
as_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
# Determine whether it's possible to make 'echo' print without a newline.
# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
# For backward compatibility with old third-party macros, we provide
# the shell variables $as_echo and $as_echo_n. New code should use
# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
as_echo='printf %s\n'
as_echo_n='printf %s'
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
test -n "$DJDIR" || exec 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Octave-Forge communications package'
PACKAGE_TARNAME='octave-forge-communications-package'
PACKAGE_VERSION='0'
PACKAGE_STRING='Octave-Forge communications package 0'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
# Factoring default headers for most tests.
ac_includes_default="\
#include
#ifdef HAVE_STDIO_H
# include
#endif
#ifdef HAVE_STDLIB_H
# include
#endif
#ifdef HAVE_STRING_H
# include
#endif
#ifdef HAVE_INTTYPES_H
# include
#endif
#ifdef HAVE_STDINT_H
# include
#endif
#ifdef HAVE_STRINGS_H
# include
#endif
#ifdef HAVE_SYS_TYPES_H
# include
#endif
#ifdef HAVE_SYS_STAT_H
# include
#endif
#ifdef HAVE_UNISTD_H
# include
#endif"
ac_header_cxx_list=
ac_subst_vars='LTLIBOBJS
LIBOBJS
HDF5_LIBS
HDF5_CFLAGS
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
SED
OBJEXT
EXEEXT
ac_ct_CXX
CPPFLAGS
LDFLAGS
CXXFLAGS
CXX
OCTAVE
MKOCTFILE
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
'
ac_precious_vars='build_alias
host_alias
target_alias
MKOCTFILE
OCTAVE
CXX
CXXFLAGS
LDFLAGS
LIBS
CPPFLAGS
CCC
PKG_CONFIG
PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
HDF5_CFLAGS
HDF5_LIBS'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'
ac_prev=
ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval $ac_prev=\$ac_option
ac_prev=
continue
fi
case $ac_option in
*=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
*=) ac_optarg= ;;
*) ac_optarg=yes ;;
esac
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file=$ac_optarg ;;
--config-cache | -C)
cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
docdir=$ac_optarg ;;
-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
ac_prev=dvidir ;;
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he | -h)
ac_init_help=long ;;
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
ac_init_help=recursive ;;
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
ac_init_help=short ;;
-host | --host | --hos | --ho)
ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
ac_prev=htmldir ;;
-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
| --ht=*)
htmldir=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
-localedir | --localedir | --localedi | --localed | --locale)
ac_prev=localedir ;;
-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
localedir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
ac_prev=pdfdir ;;
-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
pdfdir=$ac_optarg ;;
-psdir | --psdir | --psdi | --psd | --ps)
ac_prev=psdir ;;
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers | -V)
ac_init_version=: ;;
-with-* | --with-*)
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
-*) as_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
case $ac_val in
*/ )
ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
fi
ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
ac_confdir=`$as_dirname -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
eval ac_env_${ac_var}_set=\${${ac_var}+set}
eval ac_env_${ac_var}_value=\$${ac_var}
eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
eval ac_cv_env_${ac_var}_value=\$${ac_var}
done
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures Octave-Forge communications package 0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root
[DATAROOTDIR/doc/octave-forge-communications-package]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of Octave-Forge communications package 0:";;
esac
cat <<\_ACEOF
Some influential environment variables:
MKOCTFILE mkoctfile compiler helper command
OCTAVE Octave interpreter command
CXX C++ compiler command
CXXFLAGS C++ compiler flags
LDFLAGS linker flags, e.g. -L if you have libraries in a
nonstandard directory
LIBS libraries to pass to the linker, e.g. -l
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if
you have headers in a nonstandard directory
PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
HDF5_CFLAGS C compiler flags for HDF5, overriding pkg-config
HDF5_LIBS linker flags for HDF5, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to the package provider.
_ACEOF
ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
test -d "$ac_dir" ||
{ cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for configure.gnu first; this name is used for a wrapper for
# Metaconfig's "Configure" on case-insensitive file systems.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
elif test -f "$ac_srcdir/configure"; then
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
Octave-Forge communications package configure 0
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##
# ac_fn_cxx_try_compile LINENO
# ----------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_cxx_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext conftest.beam
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext
then :
ac_retval=0
else $as_nop
printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_compile
# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES
# ---------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_cxx_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
printf %s "checking for $2... " >&6; }
if eval test \${$3+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
eval "$3=yes"
else $as_nop
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
eval ac_res=\$$3
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_cxx_check_header_compile
# ac_fn_cxx_try_link LINENO
# -------------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_cxx_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
}
then :
ac_retval=0
else $as_nop
printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_link
ac_configure_args_raw=
for ac_arg
do
case $ac_arg in
*\'*)
ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append ac_configure_args_raw " '$ac_arg'"
done
case $ac_configure_args_raw in
*$as_nl*)
ac_safe_unquote= ;;
*)
ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab.
ac_unsafe_a="$ac_unsafe_z#~"
ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
esac
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Octave-Forge communications package $as_me 0, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
_ASUNAME
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
printf "%s\n" "PATH: $as_dir"
done
IFS=$as_save_IFS
} >&5
cat >&5 <<_ACEOF
## ----------- ##
## Core tests. ##
## ----------- ##
_ACEOF
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
for ac_arg
do
case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
as_fn_append ac_configure_args1 " '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
case $ac_arg in
*=* | --config-cache | -C | -disable-* | --disable-* \
| -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
| -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
| -with-* | --with-* | -without-* | --without-* | --x)
case "$ac_configure_args0 " in
"$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
esac
;;
-* ) ac_must_keep_next=true ;;
esac
fi
as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset ac_configure_args1;}
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Sanitize IFS.
IFS=" "" $as_nl"
# Save into config.log some information that might help in debugging.
{
echo
printf "%s\n" "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
sed -n \
"s/'\''/'\''\\\\'\'''\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
;; #(
*)
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
)
echo
printf "%s\n" "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
printf "%s\n" "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
printf "%s\n" "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
printf "%s\n" "$as_me: caught signal $ac_signal"
printf "%s\n" "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
printf "%s\n" "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
if test -n "$CONFIG_SITE"; then
ac_site_files="$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
else
ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
for ac_site_file in $ac_site_files
do
case $ac_site_file in #(
*/*) :
;; #(
*) :
ac_site_file=./$ac_site_file ;;
esac
if test -f "$ac_site_file" && test -r "$ac_site_file"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
|| { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
done
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
# Test code for whether the C++ compiler supports C++98 (global declarations)
ac_cxx_conftest_cxx98_globals='
// Does the compiler advertise C++98 conformance?
#if !defined __cplusplus || __cplusplus < 199711L
# error "Compiler does not advertise C++98 conformance"
#endif
// These inclusions are to reject old compilers that
// lack the unsuffixed header files.
#include
#include
// and are *not* freestanding headers in C++98.
extern void assert (int);
namespace std {
extern int strcmp (const char *, const char *);
}
// Namespaces, exceptions, and templates were all added after "C++ 2.0".
using std::exception;
using std::strcmp;
namespace {
void test_exception_syntax()
{
try {
throw "test";
} catch (const char *s) {
// Extra parentheses suppress a warning when building autoconf itself,
// due to lint rules shared with more typical C programs.
assert (!(strcmp) (s, "test"));
}
}
template struct test_template
{
T const val;
explicit test_template(T t) : val(t) {}
template T add(U u) { return static_cast(u) + val; }
};
} // anonymous namespace
'
# Test code for whether the C++ compiler supports C++98 (body of main)
ac_cxx_conftest_cxx98_main='
assert (argc);
assert (! argv[0]);
{
test_exception_syntax ();
test_template tt (2.0);
assert (tt.add (4) == 6.0);
assert (true && !false);
}
'
# Test code for whether the C++ compiler supports C++11 (global declarations)
ac_cxx_conftest_cxx11_globals='
// Does the compiler advertise C++ 2011 conformance?
#if !defined __cplusplus || __cplusplus < 201103L
# error "Compiler does not advertise C++11 conformance"
#endif
namespace cxx11test
{
constexpr int get_val() { return 20; }
struct testinit
{
int i;
double d;
};
class delegate
{
public:
delegate(int n) : n(n) {}
delegate(): delegate(2354) {}
virtual int getval() { return this->n; };
protected:
int n;
};
class overridden : public delegate
{
public:
overridden(int n): delegate(n) {}
virtual int getval() override final { return this->n * 2; }
};
class nocopy
{
public:
nocopy(int i): i(i) {}
nocopy() = default;
nocopy(const nocopy&) = delete;
nocopy & operator=(const nocopy&) = delete;
private:
int i;
};
// for testing lambda expressions
template Ret eval(Fn f, Ret v)
{
return f(v);
}
// for testing variadic templates and trailing return types
template auto sum(V first) -> V
{
return first;
}
template auto sum(V first, Args... rest) -> V
{
return first + sum(rest...);
}
}
'
# Test code for whether the C++ compiler supports C++11 (body of main)
ac_cxx_conftest_cxx11_main='
{
// Test auto and decltype
auto a1 = 6538;
auto a2 = 48573953.4;
auto a3 = "String literal";
int total = 0;
for (auto i = a3; *i; ++i) { total += *i; }
decltype(a2) a4 = 34895.034;
}
{
// Test constexpr
short sa[cxx11test::get_val()] = { 0 };
}
{
// Test initializer lists
cxx11test::testinit il = { 4323, 435234.23544 };
}
{
// Test range-based for
int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3,
14, 19, 17, 8, 6, 20, 16, 2, 11, 1};
for (auto &x : array) { x += 23; }
}
{
// Test lambda expressions
using cxx11test::eval;
assert (eval ([](int x) { return x*2; }, 21) == 42);
double d = 2.0;
assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0);
assert (d == 5.0);
assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0);
assert (d == 5.0);
}
{
// Test use of variadic templates
using cxx11test::sum;
auto a = sum(1);
auto b = sum(1, 2);
auto c = sum(1.0, 2.0, 3.0);
}
{
// Test constructor delegation
cxx11test::delegate d1;
cxx11test::delegate d2();
cxx11test::delegate d3(45);
}
{
// Test override and final
cxx11test::overridden o1(55464);
}
{
// Test nullptr
char *c = nullptr;
}
{
// Test template brackets
test_template<::test_template> v(test_template(12));
}
{
// Unicode literals
char const *utf8 = u8"UTF-8 string \u2500";
char16_t const *utf16 = u"UTF-8 string \u2500";
char32_t const *utf32 = U"UTF-32 string \u2500";
}
'
# Test code for whether the C compiler supports C++11 (complete).
ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals}
${ac_cxx_conftest_cxx11_globals}
int
main (int argc, char **argv)
{
int ok = 0;
${ac_cxx_conftest_cxx98_main}
${ac_cxx_conftest_cxx11_main}
return ok;
}
"
# Test code for whether the C compiler supports C++98 (complete).
ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals}
int
main (int argc, char **argv)
{
int ok = 0;
${ac_cxx_conftest_cxx98_main}
return ok;
}
"
as_fn_append ac_header_cxx_list " stdio.h stdio_h HAVE_STDIO_H"
as_fn_append ac_header_cxx_list " stdlib.h stdlib_h HAVE_STDLIB_H"
as_fn_append ac_header_cxx_list " string.h string_h HAVE_STRING_H"
as_fn_append ac_header_cxx_list " inttypes.h inttypes_h HAVE_INTTYPES_H"
as_fn_append ac_header_cxx_list " stdint.h stdint_h HAVE_STDINT_H"
as_fn_append ac_header_cxx_list " strings.h strings_h HAVE_STRINGS_H"
as_fn_append ac_header_cxx_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
as_fn_append ac_header_cxx_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
as_fn_append ac_header_cxx_list " unistd.h unistd_h HAVE_UNISTD_H"
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val=\$ac_cv_env_${ac_var}_value
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
# differences in whitespace do not lead to failure.
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
*) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'
and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers config.h"
# Avoid warnings for redefining AH-generated preprocessor symbols of
# Octave.
# Extract the first word of "mkoctfile", so it can be a program name with args.
set dummy mkoctfile; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_MKOCTFILE+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$MKOCTFILE"; then
ac_cv_prog_MKOCTFILE="$MKOCTFILE" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_MKOCTFILE="mkoctfile"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
MKOCTFILE=$ac_cv_prog_MKOCTFILE
if test -n "$MKOCTFILE"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKOCTFILE" >&5
printf "%s\n" "$MKOCTFILE" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
# Extract the first word of "octave", so it can be a program name with args.
set dummy octave; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_OCTAVE+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$OCTAVE"; then
ac_cv_prog_OCTAVE="$OCTAVE" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_OCTAVE="octave"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
OCTAVE=$ac_cv_prog_OCTAVE
if test -n "$OCTAVE"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OCTAVE" >&5
printf "%s\n" "$OCTAVE" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test -z "$CXX"; then
if test -n "$CCC"; then
CXX=$CCC
else
if test -n "$ac_tool_prefix"; then
for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_CXX+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$CXX"; then
ac_cv_prog_CXX="$CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CXX=$ac_cv_prog_CXX
if test -n "$CXX"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
printf "%s\n" "$CXX" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
test -n "$CXX" && break
done
fi
if test -z "$CXX"; then
ac_ct_CXX=$CXX
for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_CXX+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$ac_ct_CXX"; then
ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
if test -n "$ac_ct_CXX"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
printf "%s\n" "$ac_ct_CXX" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
test -n "$ac_ct_CXX" && break
done
if test "x$ac_ct_CXX" = x; then
CXX="g++"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CXX=$ac_ct_CXX
fi
fi
fi
fi
# Provide some information about the compiler.
printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5
printf %s "checking whether the C++ compiler works... " >&6; }
ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
* ) ac_rmfiles="$ac_rmfiles $ac_file";;
esac
done
rm -f $ac_rmfiles
if { { ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
# We set ac_cv_exeext here because the later test for it is not
# safe: cross compilers may not add the suffix if given an `-o'
# argument, so we may need to know it at that point already.
# Even if this section looks crufty: it has the advantage of
# actually working.
break;;
* )
break;;
esac
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
else $as_nop
ac_file=''
fi
if test -z "$ac_file"
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C++ compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5
printf %s "checking for C++ compiler default output file name... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
printf "%s\n" "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
printf %s "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else $as_nop
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
printf "%s\n" "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main (void)
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
printf %s "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot run C++ compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
printf "%s\n" "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
printf %s "checking for suffix of object files... " >&6; }
if test ${ac_cv_objext+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else $as_nop
printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
printf "%s\n" "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5
printf %s "checking whether the compiler supports GNU C++... " >&6; }
if test ${ac_cv_cxx_compiler_gnu+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
ac_compiler_gnu=yes
else $as_nop
ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; }
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
if test $ac_compiler_gnu = yes; then
GXX=yes
else
GXX=
fi
ac_test_CXXFLAGS=${CXXFLAGS+y}
ac_save_CXXFLAGS=$CXXFLAGS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
printf %s "checking whether $CXX accepts -g... " >&6; }
if test ${ac_cv_prog_cxx_g+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_save_cxx_werror_flag=$ac_cxx_werror_flag
ac_cxx_werror_flag=yes
ac_cv_prog_cxx_g=no
CXXFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
ac_cv_prog_cxx_g=yes
else $as_nop
CXXFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
else $as_nop
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
ac_cv_prog_cxx_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
printf "%s\n" "$ac_cv_prog_cxx_g" >&6; }
if test $ac_test_CXXFLAGS; then
CXXFLAGS=$ac_save_CXXFLAGS
elif test $ac_cv_prog_cxx_g = yes; then
if test "$GXX" = yes; then
CXXFLAGS="-g -O2"
else
CXXFLAGS="-g"
fi
else
if test "$GXX" = yes; then
CXXFLAGS="-O2"
else
CXXFLAGS=
fi
fi
ac_prog_cxx_stdcxx=no
if test x$ac_prog_cxx_stdcxx = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
printf %s "checking for $CXX option to enable C++11 features... " >&6; }
if test ${ac_cv_prog_cxx_cxx11+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_cv_prog_cxx_cxx11=no
ac_save_CXX=$CXX
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_cxx_conftest_cxx11_program
_ACEOF
for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA
do
CXX="$ac_save_CXX $ac_arg"
if ac_fn_cxx_try_compile "$LINENO"
then :
ac_cv_prog_cxx_cxx11=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cxx_cxx11" != "xno" && break
done
rm -f conftest.$ac_ext
CXX=$ac_save_CXX
fi
if test "x$ac_cv_prog_cxx_cxx11" = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
printf "%s\n" "unsupported" >&6; }
else $as_nop
if test "x$ac_cv_prog_cxx_cxx11" = x
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
printf "%s\n" "none needed" >&6; }
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5
printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; }
CXX="$CXX $ac_cv_prog_cxx_cxx11"
fi
ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11
ac_prog_cxx_stdcxx=cxx11
fi
fi
if test x$ac_prog_cxx_stdcxx = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
printf %s "checking for $CXX option to enable C++98 features... " >&6; }
if test ${ac_cv_prog_cxx_cxx98+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_cv_prog_cxx_cxx98=no
ac_save_CXX=$CXX
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_cxx_conftest_cxx98_program
_ACEOF
for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA
do
CXX="$ac_save_CXX $ac_arg"
if ac_fn_cxx_try_compile "$LINENO"
then :
ac_cv_prog_cxx_cxx98=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cxx_cxx98" != "xno" && break
done
rm -f conftest.$ac_ext
CXX=$ac_save_CXX
fi
if test "x$ac_cv_prog_cxx_cxx98" = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
printf "%s\n" "unsupported" >&6; }
else $as_nop
if test "x$ac_cv_prog_cxx_cxx98" = x
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
printf "%s\n" "none needed" >&6; }
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5
printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; }
CXX="$CXX $ac_cv_prog_cxx_cxx98"
fi
ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98
ac_prog_cxx_stdcxx=cxx98
fi
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
printf %s "checking for a sed that does not truncate output... " >&6; }
if test ${ac_cv_path_SED+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
for ac_i in 1 2 3 4 5 6 7; do
ac_script="$ac_script$as_nl$ac_script"
done
echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
{ ac_script=; unset ac_script;}
if test -z "$SED"; then
ac_path_SED_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_prog in sed gsed
do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_SED="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_SED" || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
*GNU*)
ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
*)
ac_count=0
printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
printf "%s\n" '' >> "conftest.nl"
"$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_SED_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_SED="$ac_path_SED"
ac_path_SED_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_SED_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_SED"; then
as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
fi
else
ac_cv_path_SED=$SED
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
printf "%s\n" "$ac_cv_path_SED" >&6; }
SED="$ac_cv_path_SED"
rm -f conftest.sed
# Checks for octave depreciated symbols
## Simple symbol alternatives of different Octave versions.
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
save_altsyms_CXX="$CXX"
save_altsyms_CXXFLAGS="$CXXFLAGS"
save_altsyms_CPPFLAGS="$CPPFLAGS"
save_altsyms_LDFLAGS="$LDFLAGS"
save_altsyms_LIBS="$LIBS"
OCTINCLUDEDIR=${OCTINCLUDEDIR:-`$MKOCTFILE -p INCFLAGS`}
OCTLIBDIR=${OCTLIBDIR:-`$MKOCTFILE -p OCTLIBDIR`}
CXX=`${MKOCTFILE} -p CXX`
CPPFLAGS="$OCTINCLUDEDIR $CPPFLAGS"
LDFLAGS="-L$OCTLIBDIR $LDFLAGS"
LIBS="-loctinterp $LIBS"
echo '/* generated by configure */' > oct-alt-includes.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gripe_nonconformant or octave::err_nonconformant" >&5
printf %s "checking gripe_nonconformant or octave::err_nonconformant... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main (void)
{
octave::err_nonconformant ("a",0,0)
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define OCTAVE__ERR_NONCONFORMANT octave::err_nonconformant" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: octave::err_nonconformant" >&5
printf "%s\n" "octave::err_nonconformant" >&6; }
echo '#include
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define OCTAVE__ERR_NONCONFORMANT gripe_nonconformant" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gripe_nonconformant" >&5
printf "%s\n" " gripe_nonconformant" >&6; }
echo '#include ' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gripe_wrong_type_arg or err_wrong_type_arg" >&5
printf %s "checking gripe_wrong_type_arg or err_wrong_type_arg... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main (void)
{
err_wrong_type_arg ("a", "b")
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define OCTAVE__ERR_WRONG_TYPE_ARG err_wrong_type_arg" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: err_wrong_type_arg" >&5
printf "%s\n" "err_wrong_type_arg" >&6; }
echo '#include
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define OCTAVE__ERR_WRONG_TYPE_ARG gripe_wrong_type_arg" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gripe_wrong_type_arg" >&5
printf "%s\n" " gripe_wrong_type_arg" >&6; }
echo '#include ' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gripe_square_matrix_required or err_square_matrix_required" >&5
printf %s "checking gripe_square_matrix_required or err_square_matrix_required... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main (void)
{
err_square_matrix_required ("a", "b")
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define DELOCTAVE__ERR_SQUARE_MATRIX_REQUIRED err_square_matrix_required" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: err_square_matrix_required" >&5
printf "%s\n" "err_square_matrix_required" >&6; }
echo '#include
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define DELOCTAVE__ERR_SQUARE_MATRIX_REQUIRED gripe_square_matrix_required" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gripe_square_matrix_required" >&5
printf "%s\n" " gripe_square_matrix_required" >&6; }
echo '#include ' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gripe_invalid_conversion or err_invalid_conversion" >&5
printf %s "checking gripe_invalid_conversion or err_invalid_conversion... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main (void)
{
err_invalid_conversion ("a", "b")
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define OCTAVE__ERR_INVALID_CONVERSION err_invalid_conversion" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: err_invalid_conversion" >&5
printf "%s\n" "err_invalid_conversion" >&6; }
echo '#include
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define OCTAVE__ERR_INVALID_CONVERSION gripe_invalid_conversion" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gripe_invalid_conversion" >&5
printf "%s\n" " gripe_invalid_conversion" >&6; }
echo '#include ' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking gripe_implicit_conversion or warn_implicit_conversion" >&5
printf %s "checking gripe_implicit_conversion or warn_implicit_conversion... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main (void)
{
warn_implicit_conversion ("a", "b", "c")
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define OCTAVE__WARN_INVALID_CONVERSION warn_implicit_conversion" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: warn_implicit_conversion" >&5
printf "%s\n" "warn_implicit_conversion" >&6; }
echo '#include
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define OCTAVE__WARN_INVALID_CONVERSION gripe_implicit_conversion" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gripe_implicit_conversion" >&5
printf "%s\n" " gripe_implicit_conversion" >&6; }
echo '#include ' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking flush_octave_stdout or octave::flush_stdout" >&5
printf %s "checking flush_octave_stdout or octave::flush_stdout... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main (void)
{
octave::flush_stdout ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define OCTAVE__FLUSH_STDOUT octave::flush_stdout" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: octave::flush_stdout" >&5
printf "%s\n" "octave::flush_stdout" >&6; }
echo '
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define OCTAVE__FLUSH_STDOUT flush_octave_stdout" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: flush_octave_stdout" >&5
printf "%s\n" " flush_octave_stdout" >&6; }
echo '' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking is_complex_type or iscomplex" >&5
printf %s "checking is_complex_type or iscomplex... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main (void)
{
octave_value ().iscomplex ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define OV_ISCOMPLEX iscomplex" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: iscomplex" >&5
printf "%s\n" "iscomplex" >&6; }
echo '
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define OV_ISCOMPLEX is_complex_type" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: is_complex_type" >&5
printf "%s\n" " is_complex_type" >&6; }
echo '' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking is_real_type or isreal" >&5
printf %s "checking is_real_type or isreal... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main (void)
{
octave_value ().isreal ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define OV_ISREAL isreal" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: isreal" >&5
printf "%s\n" "isreal" >&6; }
echo '
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define OV_ISREAL is_real_type" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: is_real_type" >&5
printf "%s\n" " is_real_type" >&6; }
echo '' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking is_numeric_type or isnumeric" >&5
printf %s "checking is_numeric_type or isnumeric... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main (void)
{
octave_value ().isnumeric ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define OV_ISNUMERIC isnumeric" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: isnumeric" >&5
printf "%s\n" "isnumeric" >&6; }
echo '
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define OV_ISNUMERIC is_numeric_type" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: is_numeric_type" >&5
printf "%s\n" " is_numeric_type" >&6; }
echo '' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking is_empty or isempty" >&5
printf %s "checking is_empty or isempty... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main (void)
{
octave_value ().isempty ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define OV_ISEMPTY isempty" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: isempty" >&5
printf "%s\n" "isempty" >&6; }
echo '
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define OV_ISEMPTY is_empty" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: is_empty" >&5
printf "%s\n" " is_empty" >&6; }
echo '' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking oct_mach_info::float_format or octave::mach_info::float_format" >&5
printf %s "checking oct_mach_info::float_format or octave::mach_info::float_format... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main (void)
{
octave::mach_info::float_format fmt;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
printf "%s\n" "#define OCTAVE_MACH_INFO_FLOAT_FORMAT octave::mach_info::float_format" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: octave::mach_info::float_format" >&5
printf "%s\n" "octave::mach_info::float_format" >&6; }
echo '
' >> oct-alt-includes.h
else $as_nop
printf "%s\n" "#define OCTAVE_MACH_INFO_FLOAT_FORMAT oct_mach_info::float_format" >>confdefs.h
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: oct_mach_info::float_format" >&5
printf "%s\n" " oct_mach_info::float_format" >&6; }
echo '' >> oct-alt-includes.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_header= ac_cache=
for ac_item in $ac_header_cxx_list
do
if test $ac_cache; then
ac_fn_cxx_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
printf "%s\n" "#define $ac_item 1" >> confdefs.h
fi
ac_header= ac_cache=
elif test $ac_header; then
ac_cache=$ac_item
else
ac_header=$ac_item
fi
done
if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
then :
printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/oct.h" "ac_cv_header_octave_oct_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_oct_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_OCT_H 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/base-lu.h" "ac_cv_header_octave_base_lu_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_base_lu_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_BASE_LU_H 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/lu.h" "ac_cv_header_octave_lu_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_lu_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_LU_H 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/gripes.h" "ac_cv_header_octave_gripes_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_gripes_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_GRIPES_H 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/errwarn.h" "ac_cv_header_octave_errwarn_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_errwarn_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_ERRWARN_H 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/ovl.h" "ac_cv_header_octave_ovl_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_ovl_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_OVL_H 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/oct-obj.h" "ac_cv_header_octave_oct_obj_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_oct_obj_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_OCT_OBJ_H 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/ls-oct-ascii.h" "ac_cv_header_octave_ls_oct_ascii_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_ls_oct_ascii_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_LS_OCT_ASCII_H 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/ls-oct-text.h" "ac_cv_header_octave_ls_oct_text_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_ls_oct_text_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_LS_OCT_TEXT_H 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/oct-obj.h" "ac_cv_header_octave_oct_obj_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_oct_obj_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_OCT_OBJ_H 1" >>confdefs.h
fi
ac_fn_cxx_check_header_compile "$LINENO" "octave/interpreter.h" "ac_cv_header_octave_interpreter_h" "$ac_includes_default"
if test "x$ac_cv_header_octave_interpreter_h" = xyes
then :
printf "%s\n" "#define HAVE_OCTAVE_INTERPRETER_H 1" >>confdefs.h
fi
CXX=$save_altsyms_CXX
CXXFLAGS=$save_altsyms_CXXFLAGS
CPPFLAGS=$save_altsyms_CPPFLAGS
LDFLAGS=$save_altsyms_LDFLAGS
LIBS=$save_altsyms_LIBS
have_hdf5=no
# check for HDF5 using pkg-config
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_PKG_CONFIG+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
printf "%s\n" "$PKG_CONFIG" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
if test -z "$ac_cv_path_PKG_CONFIG"; then
ac_pt_PKG_CONFIG=$PKG_CONFIG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_ac_pt_PKG_CONFIG+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $ac_pt_PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
if test "x$ac_pt_PKG_CONFIG" = x; then
PKG_CONFIG=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
PKG_CONFIG=$ac_pt_PKG_CONFIG
fi
else
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=0.9.0
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
PKG_CONFIG=""
fi
fi
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5-serial" >&5
printf %s "checking for hdf5-serial... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-serial\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-serial") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5-serial" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-serial\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-serial") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5-serial" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5-serial" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5-serial" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5-openmpi" >&5
printf %s "checking for hdf5-openmpi... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-openmpi\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-openmpi") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5-openmpi" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-openmpi\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-openmpi") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5-openmpi" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5-openmpi" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5-openmpi" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5-mpich" >&5
printf %s "checking for hdf5-mpich... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-mpich\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-mpich") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5-mpich" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-mpich\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-mpich") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5-mpich" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5-mpich" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5-mpich" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5" >&5
printf %s "checking for hdf5... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5" >&5
printf %s "checking for hdf5... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5-mpich" >&5
printf %s "checking for hdf5-mpich... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-mpich\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-mpich") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5-mpich" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-mpich\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-mpich") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5-mpich" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5-mpich" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5-mpich" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5" >&5
printf %s "checking for hdf5... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5" >&5
printf %s "checking for hdf5... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5-openmpi" >&5
printf %s "checking for hdf5-openmpi... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-openmpi\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-openmpi") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5-openmpi" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-openmpi\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-openmpi") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5-openmpi" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5-openmpi" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5-openmpi" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5-mpich" >&5
printf %s "checking for hdf5-mpich... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-mpich\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-mpich") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5-mpich" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-mpich\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-mpich") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5-mpich" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5-mpich" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5-mpich" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5" >&5
printf %s "checking for hdf5... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5" >&5
printf %s "checking for hdf5... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5-mpich" >&5
printf %s "checking for hdf5-mpich... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-mpich\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-mpich") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5-mpich" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5-mpich\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5-mpich") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5-mpich" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5-mpich" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5-mpich" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5" >&5
printf %s "checking for hdf5... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for hdf5" >&5
printf %s "checking for hdf5... " >&6; }
if test -n "$HDF5_CFLAGS"; then
pkg_cv_HDF5_CFLAGS="$HDF5_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_CFLAGS=`$PKG_CONFIG --cflags "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$HDF5_LIBS"; then
pkg_cv_HDF5_LIBS="$HDF5_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"hdf5\""; } >&5
($PKG_CONFIG --exists --print-errors "hdf5") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_HDF5_LIBS=`$PKG_CONFIG --libs "hdf5" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
HDF5_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "hdf5" 2>&1`
else
HDF5_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "hdf5" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$HDF5_PKG_ERRORS" >&5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
else
HDF5_CFLAGS=$pkg_cv_HDF5_CFLAGS
HDF5_LIBS=$pkg_cv_HDF5_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
have_hdf5=yes
fi
if test $have_hdf5 = no; then
save_CPPFLAGS="$CPPFLAGS"
save_LIBS="$LIBS"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for H5Fopen in -lhdf5" >&5
printf %s "checking for H5Fopen in -lhdf5... " >&6; }
if test ${ac_cv_lib_hdf5_H5Fopen+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lhdf5 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
namespace conftest {
extern "C" int H5Fopen ();
}
int
main (void)
{
return conftest::H5Fopen ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"
then :
ac_cv_lib_hdf5_H5Fopen=yes
else $as_nop
ac_cv_lib_hdf5_H5Fopen=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hdf5_H5Fopen" >&5
printf "%s\n" "$ac_cv_lib_hdf5_H5Fopen" >&6; }
if test "x$ac_cv_lib_hdf5_H5Fopen" = xyes
then :
have_hdf5=yes
ac_fn_cxx_check_header_compile "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default"
if test "x$ac_cv_header_hdf5_h" = xyes
then :
printf "%s\n" "#define HAVE_HDF5_H 1" >>confdefs.h
fi
HDF5_LIBS=-lhdf5
fi
CPPFLAGS="$save_CPPFLAGS"
LIBS="$save_LIBS"
fi
if test $have_hdf5 = no; then
as_fn_error $? "hdf5 not found" "$LINENO" 5
fi
comm_OCT_EVAL="$OCTAVE --norc --no-history --silent --eval"
comm_CXXFLAGS=`$MKOCTFILE -p ALL_CXXFLAGS`
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for octave_hdf5_id type" >&5
printf %s "checking for octave_hdf5_id type... " >&6; }
if test ${comm_cv_octave_hdf5_id_type+y}
then :
printf %s "(cached) " >&6
else $as_nop
comm_save_CPPFLAGS=$CPPFLAGS
comm_save_CXXFLAGS=$CXXFLAGS
CPPFLAGS="$CPPFLAGS $HDF5_CFLAGS"
CXXFLAGS="$CXXFLAGS $comm_CXXFLAGS"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main (void)
{
octave_hdf5_id x;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
comm_cv_octave_hdf5_id_type=yes
else $as_nop
comm_cv_octave_hdf5_id_type=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CPPFLAGS=$comm_save_CPPFLAGS
CXXFLAGS=$comm_save_CXXFLAGS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $comm_cv_octave_hdf5_id_type" >&5
printf "%s\n" "$comm_cv_octave_hdf5_id_type" >&6; }
if test $comm_cv_octave_hdf5_id_type = yes; then
printf "%s\n" "#define HAVE_OCTAVE_HDF5_ID_TYPE 1" >>confdefs.h
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for octave_base_value::gripe_load and octave_base_value::gripe_save" >&5
printf %s "checking for octave_base_value::gripe_load and octave_base_value::gripe_save... " >&6; }
if test ${comm_cv_octave_base_value_gripe_load_save+y}
then :
printf %s "(cached) " >&6
else $as_nop
comm_save_CPPFLAGS=$CPPFLAGS
comm_save_CXXFLAGS=$CXXFLAGS
CPPFLAGS="$CPPFLAGS $HDF5_CFLAGS"
CXXFLAGS="$CXXFLAGS $comm_CXXFLAGS"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
class foo : public octave_base_value
{
public:
foo () {}
void func () { gripe_load ("func"); gripe_save ("func"); }
};
int
main (void)
{
foo x;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
comm_cv_octave_base_value_gripe_load_save=yes
else $as_nop
comm_cv_octave_base_value_gripe_load_save=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CPPFLAGS=$comm_save_CPPFLAGS
CXXFLAGS=$comm_save_CXXFLAGS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $comm_cv_octave_base_value_gripe_load_save" >&5
printf "%s\n" "$comm_cv_octave_base_value_gripe_load_save" >&6; }
if test $comm_cv_octave_base_value_gripe_load_save = yes; then
printf "%s\n" "#define HAVE_OCTAVE_BASE_VALUE_GRIPE_LOAD_SAVE 1" >>confdefs.h
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether octave_base_value::print is const-qualified" >&5
printf %s "checking whether octave_base_value::print is const-qualified... " >&6; }
if test ${comm_cv_octave_base_value_print_const_qualified+y}
then :
printf %s "(cached) " >&6
else $as_nop
comm_save_CPPFLAGS=$CPPFLAGS
comm_save_CXXFLAGS=$CXXFLAGS
CPPFLAGS="$CPPFLAGS $HDF5_CFLAGS"
CXXFLAGS="$CXXFLAGS $comm_CXXFLAGS"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#include
int
main (void)
{
const octave_base_value x; x.print (std::cout);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
comm_cv_octave_base_value_print_const_qualified=yes
else $as_nop
comm_cv_octave_base_value_print_const_qualified=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CPPFLAGS=$comm_save_CPPFLAGS
CXXFLAGS=$comm_save_CXXFLAGS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $comm_cv_octave_base_value_print_const_qualified" >&5
printf "%s\n" "$comm_cv_octave_base_value_print_const_qualified" >&6; }
if test $comm_cv_octave_base_value_print_const_qualified = yes; then
printf "%s\n" "#define HAVE_OCTAVE_BASE_VALUE_PRINT_CONST 1" >>confdefs.h
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether first catop function argument is const-qualified" >&5
printf %s "checking whether first catop function argument is const-qualified... " >&6; }
if test ${comm_cv_octave_first_catop_fcn_arg_const_qualified+y}
then :
printf %s "(cached) " >&6
else $as_nop
comm_save_CPPFLAGS=$CPPFLAGS
comm_save_CXXFLAGS=$CXXFLAGS
CPPFLAGS="$CPPFLAGS $HDF5_CFLAGS"
CXXFLAGS="$CXXFLAGS $comm_CXXFLAGS"
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main (void)
{
octave_value foobar_fcn (const octave_base_value&,
const octave_base_value&,
const Array& ra_idx);
octave::type_info::cat_op_fcn fcn = foobar_fcn;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"
then :
comm_cv_octave_first_catop_fcn_arg_const_qualified=yes
else $as_nop
comm_cv_octave_first_catop_fcn_arg_const_qualified=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CPPFLAGS=$comm_save_CPPFLAGS
CXXFLAGS=$comm_save_CXXFLAGS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $comm_cv_octave_first_catop_fcn_arg_const_qualified" >&5
printf "%s\n" "$comm_cv_octave_first_catop_fcn_arg_const_qualified" >&6; }
if test $comm_cv_octave_first_catop_fcn_arg_const_qualified = yes; then
printf "%s\n" "#define HAVE_OCTAVE_FIRST_CATOP_ARG_CONST 1" >>confdefs.h
fi
ac_config_files="$ac_config_files Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems. If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.
_ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes: double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
) |
sed '
/^ac_cv_env_/b end
t clear
:clear
s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
case $cache_file in #(
*/* | ?:*)
mv -f confcache "$cache_file"$$ &&
mv -f "$cache_file"$$ "$cache_file" ;; #(
*)
mv -f confcache "$cache_file" ;;
esac
fi
fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
as_nop=:
if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
# Reset variables that may have inherited troublesome values from
# the environment.
# IFS needs to be set, to space, tab, and newline, in precisely that order.
# (If _AS_PATH_WALK were called with IFS unset, it would have the
# side effect of setting IFS to empty, thus disabling word splitting.)
# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
IFS=" "" $as_nl"
PS1='$ '
PS2='> '
PS4='+ '
# Ensure predictable behavior from utilities with locale-dependent output.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# We cannot yet rely on "unset" to work, but we need these variables
# to be unset--not just set to an empty or harmless value--now, to
# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
# also avoids known problems related to "unset" and subshell syntax
# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
do eval test \${$as_var+y} \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
# Ensure that fds 0, 1, and 2 are open.
if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
# Determine whether it's possible to make 'echo' print without a newline.
# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
# For backward compatibility with old third-party macros, we provide
# the shell variables $as_echo and $as_echo_n. New code should use
# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
as_echo='printf %s\n'
as_echo_n='printf %s'
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by Octave-Forge communications package $as_me 0, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
_ACEOF
case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac
case $ac_config_headers in *"
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
esac
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
--config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
instantiate the configuration header FILE
Configuration files:
$config_files
Configuration headers:
$config_headers
Report bugs to the package provider."
_ACEOF
ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
Octave-Forge communications package config.status 0
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2021 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd'
srcdir='$srcdir'
test -n "\$AWK" || AWK=awk
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
--*=)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
esac
case $ac_option in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
printf "%s\n" "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
printf "%s\n" "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append CONFIG_HEADERS " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
--help | --hel | -h )
printf "%s\n" "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
-*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
shift
done
ac_configure_extra_args=
if $ac_cs_silent; then
exec 6>/dev/null
ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
fi
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
printf "%s\n" "$ac_log"
} >&5
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers
fi
# Have a temporary directory for convenience. Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
tmp= ac_tmp=
trap 'exit_status=$?
: "${ac_tmp:=$tmp}"
{ test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' >$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
h
s///
s/^/:/
s/[ ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[ ]*\).*/\1/
G
s/\n//
s/^[^=]*=[ ]*$//
}'
fi
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with `./config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF
# Transform confdefs.h into an awk script `defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.
# Create a delimiter string that does not exist in confdefs.h, to ease
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
if test -z "$ac_tt"; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
# For the awk script, D is an array of macro values keyed by name,
# likewise P contains macro parameters if any. Preserve backslash
# newline sequences.
ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
sed -n '
s/.\{148\}/&'"$ac_delim"'/g
t rset
:rset
s/^[ ]*#[ ]*define[ ][ ]*/ /
t def
d
:def
s/\\$//
t bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3"/p
s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
d
:bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3\\\\\\n"\\/p
t cont
s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
t cont
d
:cont
n
s/.\{148\}/&'"$ac_delim"'/g
t clear
:clear
s/\\$//
t bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/"/p
d
:bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
b cont
' >$CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
for (key in D) D_is_set[key] = 1
FS = ""
}
/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
line = \$ 0
split(line, arg, " ")
if (arg[1] == "#") {
defundef = arg[2]
mac1 = arg[3]
} else {
defundef = substr(arg[1], 2)
mac1 = arg[2]
}
split(mac1, mac2, "(") #)
macro = mac2[1]
prefix = substr(line, 1, index(line, defundef) - 1)
if (D_is_set[macro]) {
# Preserve the white space surrounding the "#".
print prefix "define", macro P[macro] D[macro]
next
} else {
# Replace #undef with comments. This is necessary, for example,
# in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
if (defundef == "undef") {
print "/*", prefix defundef, macro, "*/"
next
}
}
}
{ print }
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"
eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS "
shift
for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
ac_save_IFS=$IFS
IFS=:
set x $ac_tag
IFS=$ac_save_IFS
shift
ac_file=$1
shift
case $ac_mode in
:L) ac_source=$1;;
:[FH])
ac_file_inputs=
for ac_f
do
case $ac_f in
-) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
printf "%s\n" "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
ac_sed_conf_input=`printf "%s\n" "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
case $ac_tag in
*:-:* | *:-) cat >"$ac_tmp/stdin" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
case $ac_mode in
:F)
#
# CONFIG_FILE
#
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
p
q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
case $ac_file in
-) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
*) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
:H)
#
# CONFIG_HEADER
#
if test x"$ac_file" != x-; then
{
printf "%s\n" "/* $configure_input */" >&1 \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
} >"$ac_tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
printf "%s\n" "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$ac_tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
printf "%s\n" "/* $configure_input */" >&1 \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
;;
esac
done # for ac_tag
as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded. So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status. When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
ac_cs_success=:
ac_config_status_args=
test "$silent" = yes &&
ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
communications-1.2.7/src/PaxHeaders/op-gm-s.cc 0000644 0000000 0000000 00000000074 14746720302 016216 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/op-gm-s.cc 0000644 0001750 0001750 00000013056 14746720302 015342 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
#include
#include
#include "galois.h"
#include "ov-galois.h"
#include "galois-ops.h"
// galois by scalar ops.
DEFBINOP_OP_G_S2 (add, galois, scalar, +)
DEFBINOP_OP_G_S2 (sub, galois, scalar, -)
DEFBINOP_FN_G_S2 (mul, galois, scalar, product)
DEFBINOP_FN_G_S2 (div, galois, scalar, quotient)
DEFBINOP (pow, galois, scalar)
{
CAST_BINOP_ARGS (const octave_galois&, const octave_scalar&);
return new octave_galois (pow (v1.galois_value (), v2.double_value ()));
}
DEFBINOP_FN_G_S2 (ldiv, galois, scalar, xleftdiv)
DEFBINOP_FN_B_S2 (lt, galois, scalar, mx_el_lt)
DEFBINOP_FN_B_S2 (le, galois, scalar, mx_el_le)
DEFBINOP_FN_B_S2 (eq, galois, scalar, mx_el_eq)
DEFBINOP_FN_B_S2 (ge, galois, scalar, mx_el_ge)
DEFBINOP_FN_B_S2 (gt, galois, scalar, mx_el_gt)
DEFBINOP_FN_B_S2 (ne, galois, scalar, mx_el_ne)
DEFBINOP_FN_G_S2 (el_mul, galois, scalar, product)
DEFBINOP_FN_G_S2 (el_div, galois, scalar, quotient)
DEFBINOP_FN_G (el_pow, galois, scalar, elem_pow)
DEFBINOP (el_ldiv, galois, scalar)
{
CAST_BINOP_ARGS (const octave_galois&, const octave_scalar&);
return new octave_galois (quotient (v2.matrix_value (), v1.galois_value ()));
}
DEFBINOP_FN_B_S2 (el_and, galois, scalar, mx_el_and)
DEFBINOP_FN_B_S2 (el_or, galois, scalar, mx_el_or)
DEFCATOP (gm_s, galois, scalar)
{
#if defined (HAVE_OCTAVE_FIRST_CATOP_ARG_CONST)
CAST_BINOP_ARGS (const octave_galois&, const octave_scalar&);
#else
CAST_BINOP_ARGS (octave_galois&, const octave_scalar&);
#endif
return new octave_galois (v1.galois_value (). concat (v2.matrix_value (),
ra_idx));
}
DEFASSIGNOP (assign, galois, scalar)
{
CAST_BINOP_ARGS (octave_galois&, const octave_scalar&);
v1.assign (idx, galois (1, 1, v2.scalar_value (), v1.galois_value ().m (),
v1.galois_value ().primpoly ()));
return octave_value ();
}
#ifndef DEFMETHOD_DLD
void
install_gm_s_ops (void)
{
INSTALL_BINOP (op_add, octave_galois, octave_scalar, add);
INSTALL_BINOP (op_sub, octave_galois, octave_scalar, sub);
INSTALL_BINOP (op_mul, octave_galois, octave_scalar, mul);
INSTALL_BINOP (op_div, octave_galois, octave_scalar, div);
INSTALL_BINOP (op_pow, octave_galois, octave_scalar, pow);
INSTALL_BINOP (op_ldiv, octave_galois, octave_scalar, ldiv);
INSTALL_BINOP (op_lt, octave_galois, octave_scalar, lt);
INSTALL_BINOP (op_le, octave_galois, octave_scalar, le);
INSTALL_BINOP (op_eq, octave_galois, octave_scalar, eq);
INSTALL_BINOP (op_ge, octave_galois, octave_scalar, ge);
INSTALL_BINOP (op_gt, octave_galois, octave_scalar, gt);
INSTALL_BINOP (op_ne, octave_galois, octave_scalar, ne);
INSTALL_BINOP (op_el_mul, octave_galois, octave_scalar, el_mul);
INSTALL_BINOP (op_el_div, octave_galois, octave_scalar, el_div);
INSTALL_BINOP (op_el_pow, octave_galois, octave_scalar, el_pow);
INSTALL_BINOP (op_el_ldiv, octave_galois, octave_scalar, el_ldiv);
INSTALL_BINOP (op_el_and, octave_galois, octave_scalar, el_and);
INSTALL_BINOP (op_el_or, octave_galois, octave_scalar, el_or);
INSTALL_G_CATOP (octave_galois, octave_scalar, gm_s);
INSTALL_ASSIGNOP (op_asn_eq, octave_galois, octave_scalar, assign);
}
#else
void
install_gm_s_ops (octave::type_info& ti)
{
INSTALL_BINOP_TI (ti, op_add, octave_galois, octave_scalar, add);
INSTALL_BINOP_TI (ti, op_sub, octave_galois, octave_scalar, sub);
INSTALL_BINOP_TI (ti, op_mul, octave_galois, octave_scalar, mul);
INSTALL_BINOP_TI (ti, op_div, octave_galois, octave_scalar, div);
INSTALL_BINOP_TI (ti, op_pow, octave_galois, octave_scalar, pow);
INSTALL_BINOP_TI (ti, op_ldiv, octave_galois, octave_scalar, ldiv);
INSTALL_BINOP_TI (ti, op_lt, octave_galois, octave_scalar, lt);
INSTALL_BINOP_TI (ti, op_le, octave_galois, octave_scalar, le);
INSTALL_BINOP_TI (ti, op_eq, octave_galois, octave_scalar, eq);
INSTALL_BINOP_TI (ti, op_ge, octave_galois, octave_scalar, ge);
INSTALL_BINOP_TI (ti, op_gt, octave_galois, octave_scalar, gt);
INSTALL_BINOP_TI (ti, op_ne, octave_galois, octave_scalar, ne);
INSTALL_BINOP_TI (ti, op_el_mul, octave_galois, octave_scalar, el_mul);
INSTALL_BINOP_TI (ti, op_el_div, octave_galois, octave_scalar, el_div);
INSTALL_BINOP_TI (ti, op_el_pow, octave_galois, octave_scalar, el_pow);
INSTALL_BINOP_TI (ti, op_el_ldiv, octave_galois, octave_scalar, el_ldiv);
INSTALL_BINOP_TI (ti, op_el_and, octave_galois, octave_scalar, el_and);
INSTALL_BINOP_TI (ti, op_el_or, octave_galois, octave_scalar, el_or);
INSTALL_CATOP_TI (ti, octave_galois, octave_scalar, gm_s);
INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_galois, octave_scalar, assign);
}
#endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/base-lu.cc 0000644 0000000 0000000 00000000074 14746720302 016267 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/base-lu.cc 0000644 0001750 0001750 00000010036 14746720302 015406 0 ustar 00nir nir /*
Copyright (C) 1996-2015 John W. Eaton
Copyright (C) 2009 VZLU Prague
This file is part of Octave.
Octave is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
Octave is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with Octave; see the file COPYING. If not, see
.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "base-lu.h"
template
base_lu::base_lu (const lu_type& l, const lu_type& u,
const PermMatrix& p)
: a_fact (u), l_fact (l), ipvt (p.transpose ().col_perm_vec ())
{
if (l.columns () != u.rows ())
(*current_liboctave_error_handler) ("lu: dimension mismatch");
}
template
bool
base_lu :: packed (void) const
{
return l_fact.dims () == dim_vector ();
}
template
void
base_lu :: unpack (void)
{
if (packed ())
{
l_fact = L ();
a_fact = U (); // FIXME: sub-optimal
ipvt = getp ();
}
}
template
lu_type
base_lu :: L (void) const
{
if (packed ())
{
octave_idx_type a_nr = a_fact.rows ();
octave_idx_type a_nc = a_fact.cols ();
octave_idx_type mn = (a_nr < a_nc ? a_nr : a_nc);
lu_type l (a_nr, mn, lu_elt_type (0.0));
for (octave_idx_type i = 0; i < a_nr; i++)
{
if (i < a_nc)
l.xelem (i, i) = 1.0;
for (octave_idx_type j = 0; j < (i < a_nc ? i : a_nc); j++)
l.xelem (i, j) = a_fact.xelem (i, j);
}
return l;
}
else
return l_fact;
}
template
lu_type
base_lu :: U (void) const
{
if (packed ())
{
octave_idx_type a_nr = a_fact.rows ();
octave_idx_type a_nc = a_fact.cols ();
octave_idx_type mn = (a_nr < a_nc ? a_nr : a_nc);
lu_type u (mn, a_nc, lu_elt_type (0.0));
for (octave_idx_type i = 0; i < mn; i++)
{
for (octave_idx_type j = i; j < a_nc; j++)
u.xelem (i, j) = a_fact.xelem (i, j);
}
return u;
}
else
return a_fact;
}
template
lu_type
base_lu :: Y (void) const
{
if (! packed ())
(*current_liboctave_error_handler)
("lu: Y () not implemented for unpacked form");
return a_fact;
}
template
Array
base_lu :: getp (void) const
{
if (packed ())
{
octave_idx_type a_nr = a_fact.rows ();
Array pvt (dim_vector (a_nr, 1));
for (octave_idx_type i = 0; i < a_nr; i++)
pvt.xelem (i) = i;
for (octave_idx_type i = 0; i < ipvt.numel (); i++)
{
octave_idx_type k = ipvt.xelem (i);
if (k != i)
{
octave_idx_type tmp = pvt.xelem (k);
pvt.xelem (k) = pvt.xelem (i);
pvt.xelem (i) = tmp;
}
}
return pvt;
}
else
return ipvt;
}
template
PermMatrix
base_lu :: P (void) const
{
return PermMatrix (getp (), false);
}
template
ColumnVector
base_lu :: P_vec (void) const
{
octave_idx_type a_nr = a_fact.rows ();
ColumnVector p (a_nr);
Array pvt = getp ();
for (octave_idx_type i = 0; i < a_nr; i++)
p.xelem (i) = static_cast (pvt.xelem (i) + 1);
return p;
}
template
bool
base_lu::regular (void) const
{
bool retval = true;
octave_idx_type k = std::min (a_fact.rows (), a_fact.columns ());
for (octave_idx_type i = 0; i < k; i++)
{
if (a_fact(i, i) == lu_elt_type ())
{
retval = false;
break;
}
}
return retval;
}
communications-1.2.7/src/PaxHeaders/galoisfield.cc 0000644 0000000 0000000 00000000074 14746720302 017221 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/galoisfield.cc 0000644 0001750 0001750 00000011367 14746720302 016350 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "galois.h"
#include "galoisfield.h"
#include "galois-def.h"
// The default primitive polynomials for GF(2^(indx+1))
int default_galois_primpoly[] = { 0x3, 0x7, 0xb, 0x13, 0x25,
0x43, 0x89, 0x11d, 0x211, 0x409,
0x805, 0x1053, 0x201b, 0x4443, 0x8003,
0x1100b};
galois_field_node::galois_field_node (void) :
m (0),
primpoly (0),
n (0),
next (NULL),
prev (NULL),
count (0) { }
galois_field_node::galois_field_node (const int& _m, const int& _primpoly)
{
int mask;
next = NULL;
prev = NULL;
count = 0; // Flag that field is currently bad...
// Initialize order of GF(2^m)
m = _m;
if ((m < 1) || (m > __OCTAVE_GALOIS_MAX_M))
{
gripe_order_galois (m);
return;
}
n = (1< n)
{
gripe_irred_galois (primpoly);
return;
}
count = 1; // Field is good now !!
return;
}
galois_field_node & galois_field_node::operator = (const galois_field_node &t)
{
m = t.m;
primpoly = t.primpoly;
n = t.n;
alpha_to = t.alpha_to;
index_of = t.index_of;
next = NULL;
prev = NULL;
count = 1;
return *this;
}
galois_field_list::~galois_field_list (void)
{
while (first)
{
galois_field_node * tmp = first->next;
delete first;
first = tmp;
}
}
galois_field_node*
galois_field_list::find_galois_field (const int& m, const int& primpoly)
{
galois_field_node* ptr = first;
while (ptr)
{
if ((ptr->m == m) && (ptr->primpoly == primpoly))
return ptr;
ptr = ptr->next;
}
return NULL;
}
galois_field_node*
galois_field_list::create_galois_field (const int& m, const int& primpoly)
{
galois_field_node* ptr = find_galois_field (m, primpoly);
if (ptr)
{
// We already have this field. Bump counter and return
ptr->count++;
return ptr;
}
// Create a new field and add it to the list
ptr = new galois_field_node (m, primpoly);
if (ptr->count == 0)
{
gripe_init_galois ();
return ptr;
}
if (first)
{
ptr->next = first;
first->prev = ptr;
}
else
last = ptr;
first = ptr;
return ptr;
}
int
galois_field_list::delete_galois_field (galois_field_node* field)
{
if (!field)
return 0;
field->count--;
if (field->count == 0)
{
if (field == first)
{
first = field->next;
if (first)
first->prev = NULL;
}
else if (field == last)
{
last = field->prev;
if (last)
last->next = NULL;
}
else
{
field->prev->next = field->next;
field->next->prev = field->prev;
}
delete field;
return 1;
}
else
return 0;
}
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/op-m-gm.cc 0000644 0000000 0000000 00000000074 14746720302 016210 x ustar 00 30 atime=1738252570.196528387
30 ctime=1738252593.659705065
communications-1.2.7/src/op-m-gm.cc 0000644 0001750 0001750 00000012512 14746720302 015330 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include
#include
#include
#include "galois.h"
#include "ov-galois.h"
#include "galois-ops.h"
// matrix by galois ops.
DEFBINOP_OP_G (add, matrix, galois, +)
DEFBINOP_OP_G (sub, matrix, galois, -)
DEFBINOP_OP_G (mul, matrix, galois, *)
DEFBINOP_FN_G (div, matrix, galois, xdiv)
DEFBINOP (pow, matrix, galois)
{
CAST_BINOP_ARGS (const octave_matrix&, const octave_galois&);
galois tmp (v1.matrix_value (), v2.m (), v2.primpoly ());
return new octave_galois (pow (tmp, v2.galois_value ()));
}
DEFBINOP_FN_G (ldiv, matrix, galois, xleftdiv)
DEFBINOP_FN (lt, matrix, galois, mx_el_lt)
DEFBINOP_FN (le, matrix, galois, mx_el_le)
DEFBINOP_FN (eq, matrix, galois, mx_el_eq)
DEFBINOP_FN (ge, matrix, galois, mx_el_ge)
DEFBINOP_FN (gt, matrix, galois, mx_el_gt)
DEFBINOP_FN (ne, matrix, galois, mx_el_ne)
DEFBINOP_FN_G (el_mul, matrix, galois, product)
DEFBINOP_FN_G (el_div, matrix, galois, quotient)
DEFBINOP (el_pow, matrix, galois)
{
CAST_BINOP_ARGS (const octave_matrix&, const octave_galois&);
galois tmp (v1.matrix_value (), v2.m (), v2.primpoly ());
return new octave_galois (elem_pow (tmp, v2.galois_value ()));
}
DEFBINOP (el_ldiv, matrix, galois)
{
CAST_BINOP_ARGS (const octave_matrix&, const octave_galois&);
return new octave_galois (quotient (v2.galois_value (), v1.matrix_value ()));
}
DEFBINOP_FN (el_and, matrix, galois, mx_el_and)
DEFBINOP_FN (el_or, matrix, galois, mx_el_or)
DEFCATOP_G_FN (m_gm, matrix, galois, concat)
DEFASSIGNOP_FN (assign, matrix, galois, assign)
#ifndef DEFMETHOD_DLD
void
install_m_gm_ops (void)
{
INSTALL_BINOP (op_add, octave_matrix, octave_galois, add);
INSTALL_BINOP (op_sub, octave_matrix, octave_galois, sub);
INSTALL_BINOP (op_mul, octave_matrix, octave_galois, mul);
INSTALL_BINOP (op_div, octave_matrix, octave_galois, div);
INSTALL_BINOP (op_pow, octave_matrix, octave_galois, pow);
INSTALL_BINOP (op_ldiv, octave_matrix, octave_galois, ldiv);
INSTALL_BINOP (op_lt, octave_matrix, octave_galois, lt);
INSTALL_BINOP (op_le, octave_matrix, octave_galois, le);
INSTALL_BINOP (op_eq, octave_matrix, octave_galois, eq);
INSTALL_BINOP (op_ge, octave_matrix, octave_galois, ge);
INSTALL_BINOP (op_gt, octave_matrix, octave_galois, gt);
INSTALL_BINOP (op_ne, octave_matrix, octave_galois, ne);
INSTALL_BINOP (op_el_mul, octave_matrix, octave_galois, el_mul);
INSTALL_BINOP (op_el_div, octave_matrix, octave_galois, el_div);
INSTALL_BINOP (op_el_pow, octave_matrix, octave_galois, el_pow);
INSTALL_BINOP (op_el_ldiv, octave_matrix, octave_galois, el_ldiv);
INSTALL_BINOP (op_el_and, octave_matrix, octave_galois, el_and);
INSTALL_BINOP (op_el_or, octave_matrix, octave_galois, el_or);
INSTALL_G_CATOP (octave_matrix, octave_galois, m_gm);
INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_galois, assign);
//INSTALL_ASSIGNCONV (octave_base_value, octave_matrix, octave_galois);
}
#else
void
install_m_gm_ops (octave::type_info& ti)
{
INSTALL_BINOP_TI (ti, op_add, octave_matrix, octave_galois, add);
INSTALL_BINOP_TI (ti, op_sub, octave_matrix, octave_galois, sub);
INSTALL_BINOP_TI (ti, op_mul, octave_matrix, octave_galois, mul);
INSTALL_BINOP_TI (ti, op_div, octave_matrix, octave_galois, div);
INSTALL_BINOP_TI (ti, op_pow, octave_matrix, octave_galois, pow);
INSTALL_BINOP_TI (ti, op_ldiv, octave_matrix, octave_galois, ldiv);
INSTALL_BINOP_TI (ti, op_lt, octave_matrix, octave_galois, lt);
INSTALL_BINOP_TI (ti, op_le, octave_matrix, octave_galois, le);
INSTALL_BINOP_TI (ti, op_eq, octave_matrix, octave_galois, eq);
INSTALL_BINOP_TI (ti, op_ge, octave_matrix, octave_galois, ge);
INSTALL_BINOP_TI (ti, op_gt, octave_matrix, octave_galois, gt);
INSTALL_BINOP_TI (ti, op_ne, octave_matrix, octave_galois, ne);
INSTALL_BINOP_TI (ti, op_el_mul, octave_matrix, octave_galois, el_mul);
INSTALL_BINOP_TI (ti, op_el_div, octave_matrix, octave_galois, el_div);
INSTALL_BINOP_TI (ti, op_el_pow, octave_matrix, octave_galois, el_pow);
INSTALL_BINOP_TI (ti, op_el_ldiv, octave_matrix, octave_galois, el_ldiv);
INSTALL_BINOP_TI (ti, op_el_and, octave_matrix, octave_galois, el_and);
INSTALL_BINOP_TI (ti, op_el_or, octave_matrix, octave_galois, el_or);
INSTALL_CATOP_TI (ti, octave_matrix, octave_galois, m_gm);
INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_matrix, octave_galois, assign);
//INSTALL_ASSIGNCONV (octave_base_value, octave_matrix, octave_galois);
}
#endif
/*
;;; Local Variables: ***
;;; mode: C++ ***
;;; End: ***
*/
communications-1.2.7/src/PaxHeaders/base-lu.h 0000644 0000000 0000000 00000000062 14746720302 016126 x ustar 00 20 atime=1738252482
30 ctime=1738252593.659705065
communications-1.2.7/src/base-lu.h 0000644 0001750 0001750 00000003347 14746720302 015257 0 ustar 00nir nir /*
Copyright (C) 1996-2015 John W. Eaton
Copyright (C) 2009 VZLU Prague
This file is part of Octave.
Octave is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
Octave is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with Octave; see the file COPYING. If not, see
.
*/
#if !defined (octave_base_lu_h)
#define octave_base_lu_h 1
#include "MArray.h"
#include "dColVector.h"
#include "PermMatrix.h"
template
class
base_lu
{
public:
typedef typename lu_type::element_type lu_elt_type;
base_lu (void)
: a_fact (), l_fact (), ipvt () { }
base_lu (const base_lu& a)
: a_fact (a.a_fact), l_fact (a.l_fact), ipvt (a.ipvt) { }
base_lu (const lu_type& l, const lu_type& u,
const PermMatrix& p);
base_lu& operator = (const base_lu& a)
{
if (this != &a)
{
a_fact = a.a_fact;
l_fact = a.l_fact;
ipvt = a.ipvt;
}
return *this;
}
virtual ~base_lu (void) { }
bool packed (void) const;
void unpack (void);
lu_type L (void) const;
lu_type U (void) const;
lu_type Y (void) const;
PermMatrix P (void) const;
ColumnVector P_vec (void) const;
bool regular (void) const;
protected:
Array getp (void) const;
lu_type a_fact;
lu_type l_fact;
Array ipvt;
};
#endif
communications-1.2.7/src/PaxHeaders/__errcore__.cc 0000644 0000000 0000000 00000000074 14746720302 017174 x ustar 00 30 atime=1738252570.197528394
30 ctime=1738252593.659705065
communications-1.2.7/src/__errcore__.cc 0000644 0001750 0001750 00000004501 14746720302 016313 0 ustar 00nir nir //Copyright (C) 2003 David Bateman
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, see
// .
//
// In addition to the terms of the GPL, you are permitted to link this
// program with any Open Source program, as defined by the Open Source
// Initiative (www.opensource.org)
#include
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
DEFUN_DLD (__errcore__, args, ,
"-*- texinfo -*-\n\
@deftypefn {Loadable Function} {@var{c} =} __errcore__ (@var{a}, @var{b})\n\
Returns the number of bit errors comparing the matrices @var{a} and\n\
@var{b}. These matrices must be of the same size. The return matrix @var{c}\n\
will also be of the same size.\n\
\n\
This is an internal function of @code{biterr} and @code{symerr}. You should\n\
use these functions instead.\n\
@seealso{biterr, symerr}\n\
@end deftypefn")
{
octave_value retval;
if (args.length () != 2)
{
print_usage ();
return retval;
}
Matrix a = args(0).matrix_value ();
Matrix b = args(1).matrix_value ();
if ((a.rows () != b.rows ()) || (a.cols () != b.cols ()))
{
error ("__errcore__: Matrix mismatch");
return retval;
}
unsigned int sz = (sizeof (unsigned int) << 3);
Matrix c (a.rows (), a.cols (), 0);
for (int i = 0; i < a.rows (); i++)
for (int j = 0; j < a.cols (); j++)
{
unsigned int tmp = (unsigned int)a(i,j) ^ (unsigned int)b(i,j);
if (tmp != 0)
for (unsigned int k=0; k < sz; k++)
if (tmp & (1<