| 1 | //
|
|---|
| 2 | // corrtab.h
|
|---|
| 3 | //
|
|---|
| 4 | // Copyright (C) 1997 Limit Point Systems, Inc.
|
|---|
| 5 | //
|
|---|
| 6 | // Author: Curtis Janssen <cljanss@limitpt.com>
|
|---|
| 7 | // Maintainer: LPS
|
|---|
| 8 | //
|
|---|
| 9 | // This file is part of the SC Toolkit.
|
|---|
| 10 | //
|
|---|
| 11 | // The SC Toolkit is free software; you can redistribute it and/or modify
|
|---|
| 12 | // it under the terms of the GNU Library General Public License as published by
|
|---|
| 13 | // the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 14 | // any later version.
|
|---|
| 15 | //
|
|---|
| 16 | // The SC Toolkit is distributed in the hope that it will be useful,
|
|---|
| 17 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 18 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 19 | // GNU Library General Public License for more details.
|
|---|
| 20 | //
|
|---|
| 21 | // You should have received a copy of the GNU Library General Public License
|
|---|
| 22 | // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
|
|---|
| 23 | // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|---|
| 24 | //
|
|---|
| 25 | // The U.S. Government is granted a limited license as per AL 91-7.
|
|---|
| 26 | //
|
|---|
| 27 |
|
|---|
| 28 | #ifdef __GNUC__
|
|---|
| 29 | #pragma interface
|
|---|
| 30 | #endif
|
|---|
| 31 |
|
|---|
| 32 | #ifndef _math_symmetry_corrtab_h
|
|---|
| 33 | #define _math_symmetry_corrtab_h
|
|---|
| 34 |
|
|---|
| 35 | #include <iostream>
|
|---|
| 36 |
|
|---|
| 37 | #include <math/symmetry/pointgrp.h>
|
|---|
| 38 |
|
|---|
| 39 | namespace sc {
|
|---|
| 40 |
|
|---|
| 41 | // //////////////////////////////////////////////////////////////////
|
|---|
| 42 |
|
|---|
| 43 | /** The CorrelationTable class provides a correlation
|
|---|
| 44 | table between two point groups.
|
|---|
| 45 | */
|
|---|
| 46 | class CorrelationTable: public RefCount {
|
|---|
| 47 | private:
|
|---|
| 48 | Ref<PointGroup> group_;
|
|---|
| 49 | Ref<PointGroup> subgroup_;
|
|---|
| 50 |
|
|---|
| 51 | int n_;
|
|---|
| 52 | int subn_;
|
|---|
| 53 | int *ngamma_;
|
|---|
| 54 | int **gamma_;
|
|---|
| 55 |
|
|---|
| 56 | void clear();
|
|---|
| 57 | public:
|
|---|
| 58 | CorrelationTable();
|
|---|
| 59 |
|
|---|
| 60 | /// Create a correlation table for the two groups.
|
|---|
| 61 | CorrelationTable(const Ref<PointGroup>& group,
|
|---|
| 62 | const Ref<PointGroup>& subgroup);
|
|---|
| 63 |
|
|---|
| 64 | ~CorrelationTable();
|
|---|
| 65 |
|
|---|
| 66 | /// Returns the higher order point group.
|
|---|
| 67 | Ref<PointGroup> group() const { return group_; }
|
|---|
| 68 | /// Returns the lower order point group.
|
|---|
| 69 | Ref<PointGroup> subgroup() const { return subgroup_; }
|
|---|
| 70 |
|
|---|
| 71 | /** Initalize the correlation table. Returns 0 for success and nonzero
|
|---|
| 72 | for failure. This will fail if the subgroup is not really a subgroup
|
|---|
| 73 | of group. */
|
|---|
| 74 | int initialize_table(const Ref<PointGroup>& group,
|
|---|
| 75 | const Ref<PointGroup>& subgroup);
|
|---|
| 76 |
|
|---|
| 77 | /// Converts error codes from initialize_table into a text string.
|
|---|
| 78 | const char *error(int errcod);
|
|---|
| 79 |
|
|---|
| 80 | /// Returns the number of irreps in the high order group.
|
|---|
| 81 | int n() const { return n_; }
|
|---|
| 82 | /// Returns the number of irreps in the subgroup.
|
|---|
| 83 | int subn() const { return subn_; }
|
|---|
| 84 | /// Returns the degeneracy of the irrep.
|
|---|
| 85 | int degen(int igamma) const;
|
|---|
| 86 | /// Returns the degeneracy of the subgroup irrep.
|
|---|
| 87 | int subdegen(int igamma) const;
|
|---|
| 88 | /// Returns the number of irreps in the low order group that an irrep
|
|---|
| 89 | //from the high order group can be reduced to.
|
|---|
| 90 | int ngamma(int igamma) const { return ngamma_[igamma]; }
|
|---|
| 91 | /** Returns the irreps in the low order group that an irrep from the
|
|---|
| 92 | high order group can be reduced to. */
|
|---|
| 93 | int gamma(int igamma, int i) const { return gamma_[igamma][i]; }
|
|---|
| 94 |
|
|---|
| 95 | void print(std::ostream &o=ExEnv::out0()) const;
|
|---|
| 96 | };
|
|---|
| 97 |
|
|---|
| 98 | }
|
|---|
| 99 |
|
|---|
| 100 | #endif
|
|---|
| 101 |
|
|---|
| 102 | // Local Variables:
|
|---|
| 103 | // mode: c++
|
|---|
| 104 | // c-file-style: "CLJ-CONDENSED"
|
|---|
| 105 | // End:
|
|---|