예제 #1
0
    def get_rank(self):
        """Return the reference rank from the reference rank file.

        :return: Reference rank.
        :rtype: int
        :raise StoreLoad.FileNotFoundError: Raised if reference rank file not found.
        """
        if not self.exists_rank_file():
            raise StoreLoad.FileNotFoundError(
                "%s: Reference rank file not found" % str(self))
        return int(StoreLoad.load_line(self.rank_file_path))
예제 #2
0
    def get_dimension(self):
        """Return the Dimension of the vector space.

        :return: int: Dimension of the vector space
        :rtype: int

        :raise StoreLoad.FileNotFoundError: Raised if no basis file found.
        """
        if not self.is_valid():
            return 0
        try:
            header = StoreLoad.load_line(self.get_basis_file_path())
            return int(header)
        except StoreLoad.FileNotFoundError:
            raise StoreLoad.FileNotFoundError(
                "Dimension unknown for %s: No basis file" % str(self))