{-# LANGUAGE ForeignFunctionInterface, TypeFamilies, MultiParamTypeClasses, 
             FlexibleInstances, TypeSynonymInstances, EmptyDataDecls, 
             OverlappingInstances, IncoherentInstances #-}

module HROOT.Hist.TH2I.Implementation where


import FFICXX.Runtime.Cast

import HROOT.Hist.TH2I.RawType
import HROOT.Hist.TH2I.FFI
import HROOT.Hist.TH2I.Interface
import HROOT.Hist.TH2I.Cast
import HROOT.Hist.TH1D.RawType
import HROOT.Hist.TH1D.Cast
import HROOT.Hist.TH1D.Interface
import HROOT.Hist.TF1.RawType
import HROOT.Hist.TF1.Cast
import HROOT.Hist.TF1.Interface
import HROOT.Core.TObjArray.RawType
import HROOT.Core.TObjArray.Cast
import HROOT.Core.TObjArray.Interface
import HROOT.Core.TDirectory.RawType
import HROOT.Core.TDirectory.Cast
import HROOT.Core.TDirectory.Interface
import HROOT.Core.TArrayD.RawType
import HROOT.Core.TArrayD.Cast
import HROOT.Core.TArrayD.Interface
import HROOT.Hist.TAxis.RawType
import HROOT.Hist.TAxis.Cast
import HROOT.Hist.TAxis.Interface
import HROOT.Core.TClass.RawType
import HROOT.Core.TClass.Cast
import HROOT.Core.TClass.Interface
import HROOT.Hist.TH2.RawType
import HROOT.Hist.TH2.Cast
import HROOT.Hist.TH2.Interface
import HROOT.Core.TArrayI.RawType
import HROOT.Core.TArrayI.Cast
import HROOT.Core.TArrayI.Interface
import HROOT.Hist.TH1.RawType
import HROOT.Hist.TH1.Cast
import HROOT.Hist.TH1.Interface
import HROOT.Core.TObject.RawType
import HROOT.Core.TObject.Cast
import HROOT.Core.TObject.Interface
import HROOT.Core.TAttLine.RawType
import HROOT.Core.TAttLine.Cast
import HROOT.Core.TAttLine.Interface
import HROOT.Core.TAttFill.RawType
import HROOT.Core.TAttFill.Cast
import HROOT.Core.TAttFill.Interface
import HROOT.Core.TAttMarker.RawType
import HROOT.Core.TAttMarker.Cast
import HROOT.Core.TAttMarker.Interface
import HROOT.Core.Deletable.RawType
import HROOT.Core.Deletable.Cast
import HROOT.Core.Deletable.Interface
import HROOT.Core.TArray.RawType
import HROOT.Core.TArray.Cast
import HROOT.Core.TArray.Interface

import Data.Word
import Foreign.C
import Foreign.Ptr 
import Foreign.ForeignPtr

import System.IO.Unsafe


instance ITH2I TH2I where
instance ITH2 TH2I where
  fill2 = xform2 c_th2i_fill2
  fill2w = xform3 c_th2i_fill2w
  fillN2 = xform5 c_th2i_filln2
  fillRandom2 = xform2 c_th2i_fillrandom2
  findFirstBinAbove2 = xform2 c_th2i_findfirstbinabove2
  findLastBinAbove2 = xform2 c_th2i_findlastbinabove2
  fitSlicesX = xform6 c_th2i_fitslicesx
  fitSlicesY = xform6 c_th2i_fitslicesy
  getCorrelationFactor2 = xform2 c_th2i_getcorrelationfactor2
  getCovariance2 = xform2 c_th2i_getcovariance2
  integral2 = xform5 c_th2i_integral2
  rebinX2 = xform2 c_th2i_rebinx2
  rebinY2 = xform2 c_th2i_rebiny2
  rebin2D = xform3 c_th2i_rebin2d
  setShowProjectionX = xform1 c_th2i_setshowprojectionx
  setShowProjectionY = xform1 c_th2i_setshowprojectiony
instance ITArrayI TH2I where
instance ITH1 TH2I where
  add = xform2 c_th2i_add
  addBinContent = xform2 c_th2i_addbincontent
  chi2Test = xform3 c_th2i_chi2test
  computeIntegral = xform0 c_th2i_computeintegral
  directoryAutoAdd = xform1 c_th2i_directoryautoadd
  divide = xform5 c_th2i_divide
  drawCopyTH1 = xform1 c_th2i_drawcopyth1
  drawNormalized = xform2 c_th2i_drawnormalized
  drawPanelTH1 = xform0 c_th2i_drawpanelth1
  bufferEmpty = xform1 c_th2i_bufferempty
  evalF = xform2 c_th2i_evalf
  fFT = xform2 c_th2i_fft
  fill1 = xform1 c_th2i_fill1
  fill1w = xform2 c_th2i_fill1w
  fillN1 = xform4 c_th2i_filln1
  fillRandom = xform2 c_th2i_fillrandom
  findBin = xform3 c_th2i_findbin
  findFixBin = xform3 c_th2i_findfixbin
  findFirstBinAbove = xform2 c_th2i_findfirstbinabove
  findLastBinAbove = xform2 c_th2i_findlastbinabove
  fitPanelTH1 = xform0 c_th2i_fitpanelth1
  getNdivisionA = xform1 c_th2i_getndivisiona
  getAxisColorA = xform1 c_th2i_getaxiscolora
  getLabelColorA = xform1 c_th2i_getlabelcolora
  getLabelFontA = xform1 c_th2i_getlabelfonta
  getLabelOffsetA = xform1 c_th2i_getlabeloffseta
  getLabelSizeA = xform1 c_th2i_getlabelsizea
  getTitleFontA = xform1 c_th2i_gettitlefonta
  getTitleOffsetA = xform1 c_th2i_gettitleoffseta
  getTitleSizeA = xform1 c_th2i_gettitlesizea
  getTickLengthA = xform1 c_th2i_getticklengtha
  getBarOffset = xform0 c_th2i_getbaroffset
  getBarWidth = xform0 c_th2i_getbarwidth
  getContour = xform1 c_th2i_getcontour
  getContourLevel = xform1 c_th2i_getcontourlevel
  getContourLevelPad = xform1 c_th2i_getcontourlevelpad
  getBin = xform3 c_th2i_getbin
  getBinCenter = xform1 c_th2i_getbincenter
  getBinContent1 = xform1 c_th2i_getbincontent1
  getBinContent2 = xform2 c_th2i_getbincontent2
  getBinContent3 = xform3 c_th2i_getbincontent3
  getBinError1 = xform1 c_th2i_getbinerror1
  getBinError2 = xform2 c_th2i_getbinerror2
  getBinError3 = xform3 c_th2i_getbinerror3
  getBinLowEdge = xform1 c_th2i_getbinlowedge
  getBinWidth = xform1 c_th2i_getbinwidth
  getCellContent = xform2 c_th2i_getcellcontent
  getCellError = xform2 c_th2i_getcellerror
  getEntries = xform0 c_th2i_getentries
  getEffectiveEntries = xform0 c_th2i_geteffectiveentries
  getFunction = xform1 c_th2i_getfunction
  getDimension = xform0 c_th2i_getdimension
  getKurtosis = xform1 c_th2i_getkurtosis
  getLowEdge = xform1 c_th2i_getlowedge
  getMaximumTH1 = xform1 c_th2i_getmaximumth1
  getMaximumBin = xform0 c_th2i_getmaximumbin
  getMaximumStored = xform0 c_th2i_getmaximumstored
  getMinimumTH1 = xform1 c_th2i_getminimumth1
  getMinimumBin = xform0 c_th2i_getminimumbin
  getMinimumStored = xform0 c_th2i_getminimumstored
  getMean = xform1 c_th2i_getmean
  getMeanError = xform1 c_th2i_getmeanerror
  getNbinsX = xform0 c_th2i_getnbinsx
  getNbinsY = xform0 c_th2i_getnbinsy
  getNbinsZ = xform0 c_th2i_getnbinsz
  getQuantilesTH1 = xform3 c_th2i_getquantilesth1
  getRandom = xform0 c_th2i_getrandom
  getStats = xform1 c_th2i_getstats
  getSumOfWeights = xform0 c_th2i_getsumofweights
  getSumw2 = xform0 c_th2i_getsumw2
  getSumw2N = xform0 c_th2i_getsumw2n
  getRMS = xform1 c_th2i_getrms
  getRMSError = xform1 c_th2i_getrmserror
  getSkewness = xform1 c_th2i_getskewness
  integral1 = xform3 c_th2i_integral1
  interpolate1 = xform1 c_th2i_interpolate1
  interpolate2 = xform2 c_th2i_interpolate2
  interpolate3 = xform3 c_th2i_interpolate3
  kolmogorovTest = xform2 c_th2i_kolmogorovtest
  labelsDeflate = xform1 c_th2i_labelsdeflate
  labelsInflate = xform1 c_th2i_labelsinflate
  labelsOption = xform2 c_th2i_labelsoption
  multiflyF = xform2 c_th2i_multiflyf
  multiply = xform5 c_th2i_multiply
  putStats = xform1 c_th2i_putstats
  rebin = xform3 c_th2i_rebin
  rebinAxis = xform2 c_th2i_rebinaxis
  rebuild = xform1 c_th2i_rebuild
  recursiveRemove = xform1 c_th2i_recursiveremove
  reset = xform1 c_th2i_reset
  resetStats = xform0 c_th2i_resetstats
  scale = xform2 c_th2i_scale
  setAxisColorA = xform2 c_th2i_setaxiscolora
  setAxisRange = xform3 c_th2i_setaxisrange
  setBarOffset = xform1 c_th2i_setbaroffset
  setBarWidth = xform1 c_th2i_setbarwidth
  setBinContent1 = xform2 c_th2i_setbincontent1
  setBinContent2 = xform3 c_th2i_setbincontent2
  setBinContent3 = xform4 c_th2i_setbincontent3
  setBinError1 = xform2 c_th2i_setbinerror1
  setBinError2 = xform3 c_th2i_setbinerror2
  setBinError3 = xform4 c_th2i_setbinerror3
  setBins1 = xform2 c_th2i_setbins1
  setBins2 = xform4 c_th2i_setbins2
  setBins3 = xform6 c_th2i_setbins3
  setBinsLength = xform1 c_th2i_setbinslength
  setBuffer = xform2 c_th2i_setbuffer
  setCellContent = xform3 c_th2i_setcellcontent
  setContent = xform1 c_th2i_setcontent
  setContour = xform2 c_th2i_setcontour
  setContourLevel = xform2 c_th2i_setcontourlevel
  setDirectory = xform1 c_th2i_setdirectory
  setEntries = xform1 c_th2i_setentries
  setError = xform1 c_th2i_seterror
  setLabelColorA = xform2 c_th2i_setlabelcolora
  setLabelSizeA = xform2 c_th2i_setlabelsizea
  setLabelFontA = xform2 c_th2i_setlabelfonta
  setLabelOffsetA = xform2 c_th2i_setlabeloffseta
  setMaximum = xform1 c_th2i_setmaximum
  setMinimum = xform1 c_th2i_setminimum
  setNormFactor = xform1 c_th2i_setnormfactor
  setStats = xform1 c_th2i_setstats
  setOption = xform1 c_th2i_setoption
  setXTitle = xform1 c_th2i_setxtitle
  setYTitle = xform1 c_th2i_setytitle
  setZTitle = xform1 c_th2i_setztitle
  showBackground = xform2 c_th2i_showbackground
  showPeaks = xform3 c_th2i_showpeaks
  smooth = xform2 c_th2i_smooth
  sumw2 = xform0 c_th2i_sumw2
instance ITObject TH2I where
  draw = xform1 c_th2i_draw
  findObject = xform1 c_th2i_findobject
  getName = xform0 c_th2i_getname
  isA = xform0 c_th2i_isa
  paint = xform1 c_th2i_paint
  printObj = xform1 c_th2i_printobj
  saveAs = xform2 c_th2i_saveas
  write = xform3 c_th2i_write
instance ITAttLine TH2I where
  getLineColor = xform0 c_th2i_getlinecolor
  getLineStyle = xform0 c_th2i_getlinestyle
  getLineWidth = xform0 c_th2i_getlinewidth
  resetAttLine = xform1 c_th2i_resetattline
  setLineAttributes = xform0 c_th2i_setlineattributes
  setLineColor = xform1 c_th2i_setlinecolor
  setLineStyle = xform1 c_th2i_setlinestyle
  setLineWidth = xform1 c_th2i_setlinewidth
instance ITAttFill TH2I where
  setFillColor = xform1 c_th2i_setfillcolor
  setFillStyle = xform1 c_th2i_setfillstyle
instance ITAttMarker TH2I where
  getMarkerColor = xform0 c_th2i_getmarkercolor
  getMarkerStyle = xform0 c_th2i_getmarkerstyle
  getMarkerSize = xform0 c_th2i_getmarkersize
  resetAttMarker = xform1 c_th2i_resetattmarker
  setMarkerAttributes = xform0 c_th2i_setmarkerattributes
  setMarkerColor = xform1 c_th2i_setmarkercolor
  setMarkerStyle = xform1 c_th2i_setmarkerstyle
  setMarkerSize = xform1 c_th2i_setmarkersize
instance IDeletable TH2I where
  delete = xform0 c_th2i_delete
instance ITArray TH2I where

instance ITH2I (Exist TH2I) where

instance ITH2 (Exist TH2I) where
  fill2 (ETH2I x) = fill2 x
  fill2w (ETH2I x) = fill2w x
  fillN2 (ETH2I x) = fillN2 x
  fillRandom2 (ETH2I x) = fillRandom2 x
  findFirstBinAbove2 (ETH2I x) = findFirstBinAbove2 x
  findLastBinAbove2 (ETH2I x) = findLastBinAbove2 x
  fitSlicesX (ETH2I x) = fitSlicesX x
  fitSlicesY (ETH2I x) = fitSlicesY x
  getCorrelationFactor2 (ETH2I x) = getCorrelationFactor2 x
  getCovariance2 (ETH2I x) = getCovariance2 x
  integral2 (ETH2I x) = integral2 x
  rebinX2 (ETH2I x) = rebinX2 x
  rebinY2 (ETH2I x) = rebinY2 x
  rebin2D (ETH2I x) = rebin2D x
  setShowProjectionX (ETH2I x) = setShowProjectionX x
  setShowProjectionY (ETH2I x) = setShowProjectionY x
instance ITArrayI (Exist TH2I) where

instance ITH1 (Exist TH2I) where
  add (ETH2I x) = add x
  addBinContent (ETH2I x) = addBinContent x
  chi2Test (ETH2I x) = chi2Test x
  computeIntegral (ETH2I x) = computeIntegral x
  directoryAutoAdd (ETH2I x) = directoryAutoAdd x
  divide (ETH2I x) = divide x
  drawCopyTH1 (ETH2I x) a1 = return . ETH2I =<< drawCopyTH1 x a1
  drawNormalized (ETH2I x) = drawNormalized x
  drawPanelTH1 (ETH2I x) = drawPanelTH1 x
  bufferEmpty (ETH2I x) = bufferEmpty x
  evalF (ETH2I x) = evalF x
  fFT (ETH2I x) = fFT x
  fill1 (ETH2I x) = fill1 x
  fill1w (ETH2I x) = fill1w x
  fillN1 (ETH2I x) = fillN1 x
  fillRandom (ETH2I x) = fillRandom x
  findBin (ETH2I x) = findBin x
  findFixBin (ETH2I x) = findFixBin x
  findFirstBinAbove (ETH2I x) = findFirstBinAbove x
  findLastBinAbove (ETH2I x) = findLastBinAbove x
  fitPanelTH1 (ETH2I x) = fitPanelTH1 x
  getNdivisionA (ETH2I x) = getNdivisionA x
  getAxisColorA (ETH2I x) = getAxisColorA x
  getLabelColorA (ETH2I x) = getLabelColorA x
  getLabelFontA (ETH2I x) = getLabelFontA x
  getLabelOffsetA (ETH2I x) = getLabelOffsetA x
  getLabelSizeA (ETH2I x) = getLabelSizeA x
  getTitleFontA (ETH2I x) = getTitleFontA x
  getTitleOffsetA (ETH2I x) = getTitleOffsetA x
  getTitleSizeA (ETH2I x) = getTitleSizeA x
  getTickLengthA (ETH2I x) = getTickLengthA x
  getBarOffset (ETH2I x) = getBarOffset x
  getBarWidth (ETH2I x) = getBarWidth x
  getContour (ETH2I x) = getContour x
  getContourLevel (ETH2I x) = getContourLevel x
  getContourLevelPad (ETH2I x) = getContourLevelPad x
  getBin (ETH2I x) = getBin x
  getBinCenter (ETH2I x) = getBinCenter x
  getBinContent1 (ETH2I x) = getBinContent1 x
  getBinContent2 (ETH2I x) = getBinContent2 x
  getBinContent3 (ETH2I x) = getBinContent3 x
  getBinError1 (ETH2I x) = getBinError1 x
  getBinError2 (ETH2I x) = getBinError2 x
  getBinError3 (ETH2I x) = getBinError3 x
  getBinLowEdge (ETH2I x) = getBinLowEdge x
  getBinWidth (ETH2I x) = getBinWidth x
  getCellContent (ETH2I x) = getCellContent x
  getCellError (ETH2I x) = getCellError x
  getEntries (ETH2I x) = getEntries x
  getEffectiveEntries (ETH2I x) = getEffectiveEntries x
  getFunction (ETH2I x) = getFunction x
  getDimension (ETH2I x) = getDimension x
  getKurtosis (ETH2I x) = getKurtosis x
  getLowEdge (ETH2I x) = getLowEdge x
  getMaximumTH1 (ETH2I x) = getMaximumTH1 x
  getMaximumBin (ETH2I x) = getMaximumBin x
  getMaximumStored (ETH2I x) = getMaximumStored x
  getMinimumTH1 (ETH2I x) = getMinimumTH1 x
  getMinimumBin (ETH2I x) = getMinimumBin x
  getMinimumStored (ETH2I x) = getMinimumStored x
  getMean (ETH2I x) = getMean x
  getMeanError (ETH2I x) = getMeanError x
  getNbinsX (ETH2I x) = getNbinsX x
  getNbinsY (ETH2I x) = getNbinsY x
  getNbinsZ (ETH2I x) = getNbinsZ x
  getQuantilesTH1 (ETH2I x) = getQuantilesTH1 x
  getRandom (ETH2I x) = getRandom x
  getStats (ETH2I x) = getStats x
  getSumOfWeights (ETH2I x) = getSumOfWeights x
  getSumw2 (ETH2I x) = getSumw2 x
  getSumw2N (ETH2I x) = getSumw2N x
  getRMS (ETH2I x) = getRMS x
  getRMSError (ETH2I x) = getRMSError x
  getSkewness (ETH2I x) = getSkewness x
  integral1 (ETH2I x) = integral1 x
  interpolate1 (ETH2I x) = interpolate1 x
  interpolate2 (ETH2I x) = interpolate2 x
  interpolate3 (ETH2I x) = interpolate3 x
  kolmogorovTest (ETH2I x) = kolmogorovTest x
  labelsDeflate (ETH2I x) = labelsDeflate x
  labelsInflate (ETH2I x) = labelsInflate x
  labelsOption (ETH2I x) = labelsOption x
  multiflyF (ETH2I x) = multiflyF x
  multiply (ETH2I x) = multiply x
  putStats (ETH2I x) = putStats x
  rebin (ETH2I x) = rebin x
  rebinAxis (ETH2I x) = rebinAxis x
  rebuild (ETH2I x) = rebuild x
  recursiveRemove (ETH2I x) = recursiveRemove x
  reset (ETH2I x) = reset x
  resetStats (ETH2I x) = resetStats x
  scale (ETH2I x) = scale x
  setAxisColorA (ETH2I x) = setAxisColorA x
  setAxisRange (ETH2I x) = setAxisRange x
  setBarOffset (ETH2I x) = setBarOffset x
  setBarWidth (ETH2I x) = setBarWidth x
  setBinContent1 (ETH2I x) = setBinContent1 x
  setBinContent2 (ETH2I x) = setBinContent2 x
  setBinContent3 (ETH2I x) = setBinContent3 x
  setBinError1 (ETH2I x) = setBinError1 x
  setBinError2 (ETH2I x) = setBinError2 x
  setBinError3 (ETH2I x) = setBinError3 x
  setBins1 (ETH2I x) = setBins1 x
  setBins2 (ETH2I x) = setBins2 x
  setBins3 (ETH2I x) = setBins3 x
  setBinsLength (ETH2I x) = setBinsLength x
  setBuffer (ETH2I x) = setBuffer x
  setCellContent (ETH2I x) = setCellContent x
  setContent (ETH2I x) = setContent x
  setContour (ETH2I x) = setContour x
  setContourLevel (ETH2I x) = setContourLevel x
  setDirectory (ETH2I x) = setDirectory x
  setEntries (ETH2I x) = setEntries x
  setError (ETH2I x) = setError x
  setLabelColorA (ETH2I x) = setLabelColorA x
  setLabelSizeA (ETH2I x) = setLabelSizeA x
  setLabelFontA (ETH2I x) = setLabelFontA x
  setLabelOffsetA (ETH2I x) = setLabelOffsetA x
  setMaximum (ETH2I x) = setMaximum x
  setMinimum (ETH2I x) = setMinimum x
  setNormFactor (ETH2I x) = setNormFactor x
  setStats (ETH2I x) = setStats x
  setOption (ETH2I x) = setOption x
  setXTitle (ETH2I x) = setXTitle x
  setYTitle (ETH2I x) = setYTitle x
  setZTitle (ETH2I x) = setZTitle x
  showBackground (ETH2I x) = showBackground x
  showPeaks (ETH2I x) = showPeaks x
  smooth (ETH2I x) = smooth x
  sumw2 (ETH2I x) = sumw2 x
instance ITObject (Exist TH2I) where
  draw (ETH2I x) = draw x
  findObject (ETH2I x) = findObject x
  getName (ETH2I x) = getName x
  isA (ETH2I x) = isA x
  paint (ETH2I x) = paint x
  printObj (ETH2I x) = printObj x
  saveAs (ETH2I x) = saveAs x
  write (ETH2I x) = write x
instance ITAttLine (Exist TH2I) where
  getLineColor (ETH2I x) = getLineColor x
  getLineStyle (ETH2I x) = getLineStyle x
  getLineWidth (ETH2I x) = getLineWidth x
  resetAttLine (ETH2I x) = resetAttLine x
  setLineAttributes (ETH2I x) = setLineAttributes x
  setLineColor (ETH2I x) = setLineColor x
  setLineStyle (ETH2I x) = setLineStyle x
  setLineWidth (ETH2I x) = setLineWidth x
instance ITAttFill (Exist TH2I) where
  setFillColor (ETH2I x) = setFillColor x
  setFillStyle (ETH2I x) = setFillStyle x
instance ITAttMarker (Exist TH2I) where
  getMarkerColor (ETH2I x) = getMarkerColor x
  getMarkerStyle (ETH2I x) = getMarkerStyle x
  getMarkerSize (ETH2I x) = getMarkerSize x
  resetAttMarker (ETH2I x) = resetAttMarker x
  setMarkerAttributes (ETH2I x) = setMarkerAttributes x
  setMarkerColor (ETH2I x) = setMarkerColor x
  setMarkerStyle (ETH2I x) = setMarkerStyle x
  setMarkerSize (ETH2I x) = setMarkerSize x
instance IDeletable (Exist TH2I) where
  delete (ETH2I x) = delete x
instance ITArray (Exist TH2I) where








instance FPtr (Exist TH2I) where
  type Raw (Exist TH2I) = RawTH2I
  get_fptr (ETH2I obj) = castForeignPtr (get_fptr obj)
  cast_fptr_to_obj fptr = ETH2I (cast_fptr_to_obj (fptr :: ForeignPtr RawTH2I) :: TH2I)