Load Matrix

7 views
Skip to first unread message

José Carlos de Campos

unread,
Jun 30, 2011, 7:21:13 PM6/30/11
to dx-comp...@googlegroups.com
Hi everyone,

I checkout the new version of DXC11_SoftwareTrack_DPIV_SystemDescription.pdf and read the differences between this new version and old version.

First, I think the example to load matrix presented in pdf has some mistakes:
1. int main(int argc, char **argv)
2. {
3.    config = Dxc::DxcConfig::getInstance();
4.    std::string spec = config->get("SYSTEMCAT_DIR") + DIR_DELIM + argv[1] + ".spec";
5.    std::string cat = config->get("SYSTEMCAT_DIR") + DIR_DELIM + argv[1] + ".xml";
6.    TiXmlDocument catl;
7.    catl.LoadDocument(cat);
8.    arma::umat A;
9.    A.load(spec);
10.    // Do stuff...
11.}
Line 3: "conversion from ‘Dxc::DxcConfig*’ to non-scalar type ‘Dxc::DxcConfig’ requested", solution = "Dxc::DxcConfig *config = Dxc::DxcConfig::getInstance();"
Line 4: the extension of file is .spec or .spec.gz ?
Line 7: TiXmlDocument doesn't have LoadDocument(...) method but have load(...) method.

---8<---

Second, I read the tcas matrix with Armadillo from tcas.spec.gz and print that:

A.n_rows = 9889
A.n_cols = 1
    134777631
   1305214718
   1668611842
   1932424033
      6514032
   2445401580
   1158789860
   3500981713
   2785677662

....

This is correct? The matrix of tcas has 9889 rows and 1 column ?!

---8<---

Third, If this file doesn't have the connection between test and statement, we need tcas.xml (for example) for what?


---
Regards,
José Carlos de Campos

Alberto Gonzalez

unread,
Jun 30, 2011, 7:37:38 PM6/30/11
to dx-comp...@googlegroups.com
Hi José,

Indeed I had a little misunderstanding, my bad.

The spectrum is in .spec.gz (compressed with gzip) and armadillo doesn't handle it directly. You can use boost::iostreams::gzip for example (I haven't tried this yet, I'll get back to this once I have my own implementation). This also solves the weird matrix shape, once you read with gzip it will be fine.

The TiXML method is either the constructor, or LoadFile.

The .xml file is needed to keep the framework happy (describe the system, how many components, how many probes, cost of executing test, etc.

Sorry for the mess up,
Alberto


2011/7/1 José Carlos de Campos <zecapi...@googlemail.com>



--

  Alberto González Sánchez
  Software Technology Department, EEMCS Faculty
  Delft University of Technology
  home:   www.st.ewi.tudelft.nl/~albgonz

Jeremy Mange

unread,
Aug 3, 2011, 1:22:20 PM8/3/11
to DX Competition Discussion Group
I had a question about the "spectrum" matrix M -- as I understood it,
M(i,j) would be 1 if test i covers statement j, and 0 if it does not.
However, in examining one of the given matrix files (flex.spec), there
are many values greater than 1. I am not quite sure what those values
signify. Is my understanding of this matrix wrong?

On Jun 30, 7:37 pm, Alberto Gonzalez <a.gonzalezsanc...@tudelft.nl>
wrote:
> Hi José,
>
> Indeed I had a little misunderstanding, my bad.
>
> The spectrum is in .spec.gz (compressed with gzip) and armadillo doesn't
> handle it directly. You can use boost::iostreams::gzip for example (I
> haven't tried this yet, I'll get back to this once I have my own
> implementation). This also solves the weird matrix shape, once you read with
> gzip it will be fine.
>
> The TiXML method is either the constructor, or LoadFile.
>
> The .xml file is needed to keep the framework happy (describe the system,
> how many components, how many probes, cost of executing test, etc.
>
> Sorry for the mess up,
> Alberto
>
> 2011/7/1 José Carlos de Campos <zecapisto...@googlemail.com>
>
>
>
>
>
>
>
>
>
> > Hi everyone,
>
> > I checkout the new version of *
> > DXC11_SoftwareTrack_DPIV_SystemDescription.pdf* and read the differences
> > between this new version and old version.
>
> > First, I think the example to load matrix presented in pdf has some
> > mistakes:
>
> > 1. int main(int argc, char **argv)
> > 2. {
> > 3.    config = Dxc::DxcConfig::getInstance();
> > 4.    std::string spec = config->get("SYSTEMCAT_DIR") + DIR_DELIM + argv[1] + ".spec";
> > 5.    std::string cat = config->get("SYSTEMCAT_DIR") + DIR_DELIM + argv[1] + ".xml";
> > 6.    TiXmlDocument catl;
> > 7.    catl.LoadDocument(cat);
> > 8.    arma::umat A;
> > 9.    A.load(spec);
> > 10.    // Do stuff...
> > 11.}
>
> > Line 3: "conversion from ‘Dxc::DxcConfig*’ to non-scalar type
> > ‘Dxc::DxcConfig’ requested", solution = "Dxc::DxcConfig *config =
> > Dxc::DxcConfig::getInstance();"
> > Line 4: the extension of file is .spec or .spec.gz ?
> > Line 7: TiXmlDocument doesn't have *LoadDocument(...)* method but have *
> > load(...)* method.
>
> > ---8<---
>
> > Second, I read the *tcas* matrix with Armadillo from *tcas.spec.gz* and
> > print that:
>
> > A.n_rows = 9889
> > A.n_cols = 1
> >     134777631
> >    1305214718
> >    1668611842
> >    1932424033
> >       6514032
> >    2445401580
> >    1158789860
> >    3500981713
> >    2785677662
> >    2246046289
>
> > ....
>
> > This is correct? The matrix of *tcas* has 9889 rows and 1 column ?!
>
> > ---8<---
>
> > Third, If this file doesn't have the connection between test and statement,
> > we need *tcas.xml* (for example) for what?
Reply all
Reply to author
Forward
0 new messages